PowerShell – How to copy a local file to remote machines

Easy way is

Copy-Item "C:\Test_CopyItem" -Destination "\\DC01\C$" -Recurse

Advanced Version

$source='\\server1\folder'
$destination='\\PC1\c$\temp\folder'
Copy-Item -Recurse -Filter *.* -path $source -destination $destination -Force

Leave a Reply

Your email address will not be published. Required fields are marked *