Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell copy folder to remote computer

Start-Transcript -path 'c:scriptlog.txt'
$ServerList         = import-csv 'C:powershellWorkstation-test.CSV'
$SourceFileLocation = 'C:Niche'
$Destination        = 'C$Niche'
 
foreach ($_ in $ServerList.computer){
    remove-item "$_$Destination" -Recurse -Force -Verbose
    Copy-Item $SourceFileLocation -Destination "$_$Destination" -Recurse -Verbose
}
Stop-Transcript
Source by community.spiceworks.com #
 
PREVIOUS NEXT
Tagged: #powershell #copy #folder #remote #computer
ADD COMMENT
Topic
Name
1+7 =