I am developing a PowerShell script for calculating checksum of zip files. I have to execute it in both W7 and W10. I have noticed that certUtil commmand returns strings like A2 5B 8A... in W7, but in W10 it returns the same string but without spaces. So I decided to remove the spaces to uniform it, setting the output to a variable and then remove the spaces... but it does not work.
for /f "delims=" %%f in ('dir %~dp0*.zip /b') do (
echo %%~f:
$result = certUtil -hashfile "%~dp0%%~f" SHA512 | find /i /v "SHA512" |
find /i /v "certUtil"
$result = $result -replace '\s', ''
echo %result%
set /a counter += 1
echo.
)
Do you know how to remove them?