Last active
June 14, 2021 19:23
-
-
Save asabla/96f9736a13ff353b35a337609fa07ddc to your computer and use it in GitHub Desktop.
Find duplicated files with powershell
This file contains hidden or 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
Get-ChildItem -Recurse -File | | |
Group-Object Length | | |
Where-Object { $_.Count -gt 1 } | | |
select -ExpandProperty group | | |
foreach { Get-FileHash -LiteralPath $_.FullName } | | |
group -Property hash | | |
where { $_.count -gt 1 } | | |
select -ExpandProperty group |
This file contains hidden or 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
Get-ChildItem -Recurse -File | | |
Group-Object Name | | |
Where-Object { $_.Count -gt 1 } | | |
Select -ExpandProperty Group | | |
foreach { Get-FileHash -LiteralPath $_.FullName } | | |
group -Property hash | | |
where { $_.count -gt 1 } | | |
select -ExpandProperty group | | |
%{ $_.path } |
This file contains hidden or 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
Get-ChildItem -Recurse -File | | |
Group-Object Name | | |
Where-Object { $_.Count -gt 1 } | | |
Select -ExpandProperty Group | | |
foreach { Get-FileHash -LiteralPath $_.FullName } | | |
group -Property hash | | |
where { $_.count -gt 1 } | | |
select -ExpandProperty group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment