Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bradbrowne/f2337b2214d5219cccbf4e9a2f9d52f3 to your computer and use it in GitHub Desktop.
Save bradbrowne/f2337b2214d5219cccbf4e9a2f9d52f3 to your computer and use it in GitHub Desktop.
Loop through a text file containing file paths and use Robocopy to copy from source to destination using restartable and other options.
gc example.txt | % { robocopy $([System.IO.Path]::GetDirectoryName($_)) .\dst $([System.IO.Path]::GetFileName($_)) /z /w:20 /r:20 /j}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment