I'm trying to Find any duplicate files from my computer, I am using length and hash to speed the process,
Someone told me I can improve the speed of my code changing the algorithm of hashing to MD5, I don't know where I have to write that, I copied my code to show you what I'm trying to do.
$srcDir = "C:\Users\Dell\Documents"
Measure-Command {
Get-ChildItem -Path $srcDir -File -Recurse | Group -Property Length |
where { $_.Count -gt 1 } | select -ExpandProperty Group |
Get-FileHash -Algorithm MD5 |
Group -Property Hash | where { $_.count -gt 1 } |
foreach { $_.Group | select Path, Hash }
}