Created
February 18, 2020 13:24
-
-
Save eschen42/3b961152ca5d220a91c1d6cdb0a31ae5 to your computer and use it in GitHub Desktop.
powershell commandlet based MD5 hashing - much slower than FCIV
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
| setlocal | |
| set DASH_R=TRUE | |
| set BASE_PATH=%CD%\ | |
| set BASE_PATH=%BASE_PATH::=.% | |
| set BASE_PATH=%BASE_PATH:\=.% | |
| if %DASH_R% == FALSE powershell -Command "Get-FileHash -Algorithm MD5 -Path %1\* | Sort-Object Path | Select-Object -Property Hash,Path | Out-String -Stream" | sed -e "/^Hash/d; /^---/d; /^$/d; s/%BASE_PATH%//" | |
| if %DASH_R% == TRUE for /f "delims=" %%D in ('dir/on/s/ad-h/b %1 ^| grep -v "[\][.]"') do @powershell -Command "Get-FileHash -Algorithm MD5 -Path '%%D\*' | Sort-Object Path | Select-Object -Property Hash,Path | Out-String -Stream" | sed -e "/^Hash/d; /^---/d; /^$/d; s/%BASE_PATH%//" | |
| endlocal |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Microsoft FCIV is very fast and very old. This was my attempt at a slightly more modern implementation, but the performance is ridiculously slower than FCIV.