title: 'Rename-Item' makes a copy with the new name
body: <p>Trying to make a script to backup specific folders and then rename the GUID key for the target user under HKLM...\ProfileLists but the rename-item command makes a copy of the key and creates a new key with the appended name though having full access</p>
  
  <p>Tried with -force, tried with move-item instead of rename but it gives the exact same results, a new identical key as original but with an appended name</p>
  
  <pre class="lang-bsh prettyprint-override"><code>if ((Test-Path $FULLPATH)) { 
      Rename-Item $FULLPATH -NewName "$SSID.bak" -Force 
      if ($?) { 
           Write-Host "$USERNAME was SUCCESSFULLY renamed in the registry" 
      } 
  } 
  </code></pre>
  
  <p>Expected result is to only rename the GUID-key in the registry.
  Actual result is a duplicate key with the new duplicate to have the correct appended name.</p>
  
  <blockquote>
    <p>Rename-Item : The registry key at the specified path does not exist.
    At line:9 char:5
    +     Rename-Item $FULLPATH -NewName "$SSID.bak" -Force
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidArgument:   (HKEY_LOCAL_MACH...\folderredirect:String) [Rename-Item], ArgumentException
        + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.RenameItemCommand</p>
    
    <p>Rename-Item : Object reference not set to an instance of an object.
    At line:9 char:5
    +     Rename-Item $FULLPATH -NewName "$SSID.bak" -Force
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Rename-Item], NullReferenceException
        + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.RenameItemCommand </p>
  </blockquote>
  
  <p>The key does exist and I can run the same command again as proof (due to the test-path).</p>
  
  <p>Verbose output do confirm its copying</p>
  
  <pre><code>VERBOSE: Performing the operation "Copy Key" on target "the key in question"
  </code></pre>