Skip to content

Instantly share code, notes, and snippets.

@aadennis
Created June 11, 2017 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aadennis/7441dfe747b35560e21b82a72f93d792 to your computer and use it in GitHub Desktop.
Save aadennis/7441dfe747b35560e21b82a72f93d792 to your computer and use it in GitHub Desktop.
# Try to remove all files from a named folder, typically on a DVD
#Remove-Item -Path E:\Set1 -Recurse -Force
$targetDir = "E:\Set1b"
$set = gci -Path $srcDir -Filter *.mp4
$set | % {
$file = $_
$baseName = $file.BaseName
$target = "$targetDir/$baseName.mp4"
"Deleting [$target]"
Remove-Item -Path $target -Force -ErrorAction Continue
Start-Sleep 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment