help with powershell 5.1 script for copying and moving folders and all their contents

R

Ryan Burton

This is the script I wrote:$sources = Read-Host "Enter source folder paths (comma-separated)" $sourceList = $sources -split ',' $destinations = @("E:\DestinationFolder1", "F:\DestinationFolder2", "W:\DestinationFolder3", "\\ServerName\SharedFolderDestination") foreach ($source in $sourceList) { foreach ($destination in $destinations) { Copy-Item -Path $source -Destination $destination -Recurse -Force } if (test-path "M:\"){ move-item -Path $source -Destination $destination -recurse -force } } }What I need it to do is always read from the same folderandask at the b

Continue reading...
 
Back
Top Bottom