$ErrorActionPreference = 'Stop' $file = '.\LDK.Wallet_0.4.28_x64-setup.exe' $manifest = '.\SHA256SUMS-windows-x86_64.txt' $entry = (Get-Content -LiteralPath $manifest -Raw).Trim() if ($entry -notmatch '^([0-9a-fA-F]{64})\s+\*?LDK Wallet_0\.4\.28_x64-setup\.exe$') { throw 'Unexpected checksum entry. Check the release, platform and filename.' } $expected = $Matches[1] $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash if ($actual -ine $expected) { throw 'Checksum mismatch. Stop here and download the matching files again.' } "SHA-256 matches: $actual"