Skip to content

Instantly share code, notes, and snippets.

@tuantmb
Created October 21, 2023 09:16
Show Gist options
  • Save tuantmb/21c4e04c51ea920b8d009988557d44d4 to your computer and use it in GitHub Desktop.
Save tuantmb/21c4e04c51ea920b8d009988557d44d4 to your computer and use it in GitHub Desktop.
Powershell to list duplicate files in current directory
Get-ChildItem * -Recurse | Get-FileHash -Algorithm MD5 | Group-Object hash | Where-Object {$_.Count -gt 1} | Select-Object @{n='DupeCount';e={$_.Count}}, @{n='DupeFiles';e={$_.Group.Path -join [System.Environment]::NewLine}}, @{n='Hash';e={$_.Name}} | Out-GridView
@tuantmb
Copy link
Author

tuantmb commented Oct 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment