0

I need to copy a list of files to a list of different destination folders. My current script that I am using works with one destination. How do I get it to work for multiple destinations?

# source and destionation directory
$src_dir = "C:\test\"
$dst_dir = "\\remote_PC\c$\test"

# list of files from source directory that I want to copy to destination folder
# unconditionally
$file_list = "*.txt", 
             "*.jpg",
             "*.doc"

# Copy each file unconditionally (regardless of whether or not the file is there
foreach ($file in $file_list)
{
  Copy-Item $src_dir$file $dst_dir
}
Eric
  • 863
  • 4
  • 17
  • 31

0 Answers0