title: In PowerShell how to copy files from a Remote PSsession to another Windows server
body: <p>I am trying to copy a folder from one remote server to another inside a PSSession, it's giving errors like access is denied. I have admin privileges to both of the servers. If I try it without PSSession it works.</p>
  
  <p>In remote serverA</p>
  
  <pre><code>PS C:\Users\Automation\Documents&gt; [System.Net.Dns]::GetHostName()
  sql
  PS C:\Users\Automation\Documents&gt; Copy-Item -Path .\abc.csv -Destination "\\jump\c$"
  PS C:\Users\Automation\Documents&gt;
  </code></pre>
  
  <p>In remote serverB</p>
  
  <pre><code>    PS C:\Users\Automation\Documents\sample\SQL Final Scripts&gt; Copy-Item -Path ".\SQL_queries.csv" -Destination "\\sql\c$\"
      PS C:\Users\Automation\Documents\sample\SQL Final Scripts&gt; Enter-PSSession -ComputerName sql  -Credential "automation@lab"
  
      [sql]: PS C:\Users\Automation\Documents&gt; Copy-Item -Path ".\SQL_queries.csv" -Destination "\\jump\c$\"
  
  
  Copy-Item : Access to the path '\\jump\c$\' is denied.
          + CategoryInfo          : PermissionDenied: (C:\Users\Automa...SQL_queries.csv:FileInfo) [Copy-Item], Unauthorized
         AccessException
          + FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand
  
  
      [sql]: PS C:\Users\Automation\Documents&gt;
  </code></pre>