title: PowerShell Command to Copy File on Remote Machine
body: <p>I have a requirement to copy file from local machine to remote machine using PowerShell. I can copy the file to remote computer using following command:</p>
  
  <pre><code>copy-item -Path d:\Shared\test.txt -Destination \\server1\Shared
  </code></pre>
  
  <p>the above command uses network share path to copy the file. I don't want to use network share option as the folder will not be shared on the remote machine. I tried following commands but not working.</p>
  
  <pre><code>copy-item -Path d:\Shared\test.txt -Destination \\server1\c$\Shared
  
  Invoke-Command -ComputerName \\server -ScriptBlock {
    copy-item -Path D:\Shared\test.txt -Destination C:\Shared
  }
  </code></pre>
  
  <p>Please let me know how to make it working without using UNC path. I have full permissions on that folder on the remote machine.</p>