Skip to content

Instantly share code, notes, and snippets.

@jamessantiago
Last active December 11, 2015 20:09
Show Gist options
  • Save jamessantiago/4653164 to your computer and use it in GitHub Desktop.
Save jamessantiago/4653164 to your computer and use it in GitHub Desktop.
Script to copy a directory using bits and retain it's structure
Import-Module BitsTransfer
$s = "C:\Source"
$d = "D:\Destination"
xcopy.exe /T /E $s $d
ls $s -Recurse |? {! $_.PSIsContainer} |% {
$e = $_.FullName.Remove(0, $s.Length + 1)
start-bitstransfer $($_.FullName) $d\$e
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment