One neat feature of the April 2015 WMF 5.0 preview is that you can copy files over a remoting session.
First create a session to a remote machine
$cs = New-PSSession -ComputerName W12R2SUS
Define the source and destination for the copy. Use –ToSession to determine the remoting session you will use to determine the remote machine
Copy-Item -Path C:\Source\test.csv -Destination C:\Source\test.csv -ToSession $cs
You use –FromSession to copy from a remote machine
Copy-Item -Path C:\Source\srv.csv -Destination C:\Source\srv.csv -FromSession $cs
What you can’t do is copy from one session to another
$cs2 = New-PSSession -ComputerName server02
£> Copy-Item -Path C:\Source\*.csv -Destination C:\Source\ -FromSession $cs2 -ToSession $cs
Copy-Item : ‘-FromSession’ and ‘-ToSession’ are mutually exclusive and cannot be specified at the same time.
Hi, have you seen any way to force “any file” to be copied? It seems that current release of PS limits this functionality to only files that you know the names of… using something like *.csv returns an error…
see https://richardspowershellblog.wordpress.com/2015/09/30/controlling-copies/
How do you send it to Multiple computers in Parallel?
see
Is that possible to use this new feature to copy from a server with Powershell 5.0 to another one with Powershell 2.0?
No. Both sessions have to be PowerShell 5.0 or 5.1
If you need to copy to a remote machine running PowerShell 2.0 you’d be better using a UNC path as the target