Skip to content

Instantly share code, notes, and snippets.

@quentinproust
Created June 5, 2015 16:19
Show Gist options
  • Save quentinproust/8d3bd11562a12446644f to your computer and use it in GitHub Desktop.
Save quentinproust/8d3bd11562a12446644f to your computer and use it in GitHub Desktop.
Remove duplicate files with powershell
ls | Get-FileHash
| Group-Object -Property Hash
| Where-Object -Property Count -gt 1
| ForEach-Object { $_.Group.Path | select -First ($_.Count -1)}
| Remove-Item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment