3 ms·
ls -File | % { $fh = Get-FileHash $_ SHA1; if ($_.Name -match $fh.hash) {$_} }
by majkinetor 4y ago
ls -File | % { $fh = Get-FileHash $_ SHA1; if ($_.Name -match $fh.hash) {$_} }
- GuB-42 4y agoDoesn't work, it is not recursive and it was a CRC, not SHA1 but I probably could have found a solution starting from there. Anyways, it was a long time ago, maybe I will give PowerShell a retry at some point.
- majkinetor 4y agoOfc. it works. If on linux, replace ls with `gci`. Recursion is done with ls -Recurse. Install-Package CRC. Its still single liner.