I’m trying to copy a file to a new folder on a remote server but its creating the new folder on my computer, not on the server. NEED HELP!
This is what I have:
$AO = New-PSSession -ComputerName “computer” -Credential “user”
Copy-Item -Path “C:\Test1.txt” -Destination (New-Item -Path “C:\Tools\prac” -ItemType “directory”) -Force -ToSession $AO