Last active
April 6, 2023 11:18
-
-
Save b4tman/6071d3b9d8e460362db792862cc04cef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dups = Get-ChildItem -Recurse -File -Exclude "dups.csv" | | |
Get-FileHash -Algorithm SHA256 | | |
Select-Object -Property Hash, Path | | |
Group-Object -Property Hash | | |
Where-Object -Property Count -ge 2 | | |
Sort-Object -Property Count -Descending | | |
Select-Object -Property Count -ExpandProperty Group | | |
Select-Object -Property Count, Hash, Path | |
$dups | ConvertTo-Csv -NoTypeInformation | | |
Out-File -Encoding utf8 -FilePath "dups.csv" | |
$dups |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment