Skip to content

Instantly share code, notes, and snippets.

@stesee
Created November 18, 2018 15:06
Show Gist options
  • Save stesee/5fff7ad1b436e8086c7778e3318d6766 to your computer and use it in GitHub Desktop.
Save stesee/5fff7ad1b436e8086c7778e3318d6766 to your computer and use it in GitHub Desktop.
powershell snippet deletes files duplicated files by comparing their hash
ls *.txt -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment