Try this:
Import-Csv X:\SomeDirectory\SomeFileName.csv |
ForEach-Object{
$cmdArgs = "D:\homedrive\$($_.username)\Chrome", "D:\Chrome\$($_.username)", "/e"
Robocopy $cmdArgs
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have been trying to google how to do this and I am having trouble finding a good example that helps me learn how to do this.
I need a Script that will run a Robocopy command on a list of about 530 users. The RoboCopy command I need to run is
Robocopy "D:\homedrive\$username\Chrome" "D:\Chrome\$username" /e
the user names I need to run this against will be in a CSV file in a single column "username"
can get some help from the Script writers out there to make this work?
the Script will be ran on the server the files are being moved on.
Thank you.
Try this:
Import-Csv X:\SomeDirectory\SomeFileName.csv |
ForEach-Object{
$cmdArgs = "D:\homedrive\$($_.username)\Chrome", "D:\Chrome\$($_.username)", "/e"
Robocopy $cmdArgs
}