Skip to content

Instantly share code, notes, and snippets.

@jespernohr
Created February 4, 2017 17:41
Show Gist options
  • Save jespernohr/f95821f32969a179289d19ca159a4c78 to your computer and use it in GitHub Desktop.
Save jespernohr/f95821f32969a179289d19ca159a4c78 to your computer and use it in GitHub Desktop.
$cred = Get-Credential
$s = New-PSSession -ComputerName server1.contoso.com -Credential $cred
#Copy files to server
Copy-Item -ToSession $s -Path C:\test\test.txt -Destination D:\Test\
#Copy files from server
Copy-Item -FromSession $s -Path C:\Temp\test.txt -Destination C:\test\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment