Forum Discussion
Komondor2240
Jun 11, 2025Iron Contributor
deleting duplicate files the same
I had an ASUS puter crash and lost many files. A tech guy got many of them back. Meanwhile I bought an HP, but still have both. I transferred many files into the new HP. They both have terrabyte HDs....
BramwellStone
Jun 12, 2025Iron Contributor
Quickly find and delete duplicate files with PowerShell commands:
Get-ChildItem -Path "Destination Folder Path" -Recurse | Group-Object Length,Name | Where-Object { $_.Count -gt 1 } | ForEach-Object { $_.Group | Select-Object -Skip 1 | Remove-Item -Verbose }
It is recommended to run a simulation with the -WhatIf parameter to confirm the result before execution.