title: Copy-Item destination path ignored within remote server powershell
body: <p>I am trying to make a folder backup in a remote server. Basically I want to copy the folder <code>c:\Services\MainService</code> and its contents to this other folder <code>c:\Services\backups\backup_001</code> within the remote server. </p>
  
  <p>I am using a <code>New-PSSession</code> object to connect to the remote server. The account I am using is a <code>Built-In/Administrator</code> in the remote server.</p>
  
  <p>Then I am using a powershell script in my local machine which has the following command to execute the copy-item in the remote server:</p>
  
  <pre><code>Invoke-Command -Session $connection -ScriptBlock { Copy-Item -Path C:\Services\MainService -Destination C:\Services\backups\backup_001 -Recurse -Force }
  </code></pre>
  
  <p>After executing the script I logged-in into the remote server and I didn't see the files in the destination path I specified in the <code>copy-item</code> command. Instead I saw the original folder inside the local user folder of the account used to connect to the remove server:<code>C:\Users\{accountname}\Documents\MainService</code></p>
  
  <p>The <code>-Destination</code> path is being ignored. I have been trying with different accounts but I get the same result every time. All the accounts I have been using to connect to the remote server through <code>New-PSSession</code> are <code>BUILT-IN/Administrator</code> in the remote server.</p>