Hi, I need to copy files to 100 servers. What should I do? * An error is as follows:
Copy-Item : Cannot convert ‘System.Object’ to the type ‘System.Management.Automation.Runspaces.PSSession’ required by parameter ‘ToSession’. Speci
fied method is not supported.
$s=New-PSSession -ComputerName (Import-Csv c:\1.csv).hostname
Copy-Item -Path C:\BESRemove.exe -Destination C:\BESRemove.exe -Recurse -Force -ToSession $s
Copy-Item -Path C:\treesizefree.exe -Destination C:\treesizefree.exe -Recurse -Force -ToSession $s