Verify a File Download Checksum in PowerShell (Windows)

You can confirm a downloaded file’s integrity by generating and comparing its checksum in PowerShell.

1. Generate the file's checksum

Get-FileHash "C:\Path\To\File.iso" -Algorithm SHA256

Example output:

Algorithm : SHA256
Hash      : 9F1ABCD1234EFA...
Path      : C:\Path\To\File.iso

2. Compare with publisher's checksum

If the hash matches exactly, the file is verified.

3. Automated comparison (optional)

$expected = "9F1ABCD1234EFA..."
$actual = (Get-FileHash "C:\Path\To\File.iso" -Algorithm SHA256).Hash

if ($actual -eq $expected) {
    "Match: File is good."
} else {
    "NOPE: Hash mismatch."
}
Verify a File Download Checksum on Linux

Linux systems include checksum tools such as sha256sum for file integrity checks.

1. Generate the file's checksum

sha256sum /path/to/file.iso

Example output:

9f1abcd1234efa...  /path/to/file.iso

2. Compare with publisher's checksum

If the values match exactly, the file is safe and unmodified.

3. Automated comparison (optional)

expected="9f1abcd1234efa..."
actual=$(sha256sum /path/to/file.iso | awk '{print $1}')

if [ "$actual" = "$expected" ]; then
  echo "Match: File is good."
else
  echo "NOPE: Hash mismatch."
fi
Verify a File Download Checksum on macOS

macOS includes built-in checksum utilities such as shasum for verifying downloaded files.

1. Generate the file's checksum

shasum -a 256 /path/to/file.dmg

Example output:

9f1abcd1234efa...  /path/to/file.dmg

2. Compare with publisher's checksum

If they match exactly, the file is verified.

3. Automated comparison (optional)

expected="9f1abcd1234efa..."
actual=$(shasum -a 256 /path/to/file.dmg | awk '{print $1}')

if [ "$actual" = "$expected" ]; then
  echo "Match: File is good."
else
  echo "NOPE: Hash mismatch."
fi
Home  |  Ultimate Boot CD (External)  |  Legal  |  Privacy Policy  |  Terms of Use  |  FAQ