When I try to copy files from the remote machine to local machine, I get the error:
Copy-Item : A parameter cannot be found that matches parameter name 'FromSession'.
I copy files to the same drive and the drive and path exists in both the machine.
Is this expected behavior?
$sessions = New-PSSession -ComputerName "xxxxxx"
$sessions | ForEach-Object { Copy-Item -FromSession $_ -Path c:\Test2\\*.txt -Destination C:\Test2 }