How to Verify a Downloaded File’s SHA-256 Hash with PowerShell

November 10, 2026

Before running an installer or using an operating-system image, compare its checksum with the value published by the software vendor. A checksum is a compact representation of file contents: it helps you detect a damaged download or an unexpected change.

This walkthrough uses a local file on Windows 11. It does not upload the file to a third-party checking service.

Documentation reviewed: 10 November 2026. These instructions were verified against the Microsoft sources below; Guava has not independently executed this procedure in a live environment.

Before you begin

  • Use Windows PowerShell 5.1 or PowerShell 7. The Get-FileHash command is documented for both.
  • Have read access to the completed download. Use an ordinary PowerShell session; do not elevate merely to check a file in your Downloads folder.
  • Obtain the SHA-256 value from the publisher’s official download or release page. Match the exact release, language, architecture, and package type.
  • No additional PowerShell module or paid checksum utility is required.

Security boundary: a hash comparison is only as trustworthy as the expected hash. A matching value copied from the same untrusted source as a malicious file is not evidence that the download is safe.

1. Identify the file and calculate its hash

  1. Wait for the download to finish. Keep the file closed and unchanged while checking it.
  2. Open Start, search for Windows PowerShell, and open it.
  3. Replace the example path below with your file’s full path, keeping the quotation marks. Run the command.
Get-FileHash -LiteralPath 'C:\Users\Will\Downloads\installer.exe' -Algorithm SHA256 | Format-List

The result contains Algorithm, Hash, and Path. Confirm the path before comparing the hash. -LiteralPath treats brackets and other wildcard characters literally. Hashing reads the contents without executing the installer.

2. Compare the complete checksum

For an explicit comparison, replace both placeholders below. Paste only the vendor’s hexadecimal checksum, without a filename, label, or internal spaces.

$downloadPath = 'C:\Users\Will\Downloads\installer.exe'
$expectedHash = 'PASTE_THE_PUBLISHERS_SHA256_HERE'
$actualHash = (Get-FileHash -LiteralPath $downloadPath -Algorithm SHA256 -ErrorAction Stop).Hash
$actualHash -eq $expectedHash

PowerShell’s -eq comparison returns True for equal strings and False for unequal strings. It ignores letter case, so uppercase versus lowercase hexadecimal letters do not cause a mismatch. These are expected outcomes, not output captured from a test.

If hashing reports an error, stop there. Do not run the comparison separately using a value left over from an earlier check.

3. Decide what to do next

Result Next action
True The computed checksum matches the reference you supplied. Continue your normal publisher, antivirus, and organizational approval checks.
False Do not run the download. Recheck the selected release and copied checksum, then download a fresh copy from the official source if necessary.
Path or access error Correct the path, ensure the download exists locally, and confirm you have permission to read it. Do not change folder permissions simply to bypass the error.

Optional: inspect a Windows file’s digital signature

For a signed installer, inspect its Authenticode signature as an additional check:

Get-AuthenticodeSignature -LiteralPath 'C:\Users\Will\Downloads\installer.exe' | Format-List

This Windows-only command reports signature information. Review the status and signer certificate against the publisher you expected. An unsigned file is not automatically malicious; a valid signature is not a promise that software is harmless. Investigate unexpected publishers or signature failures before execution.

Troubleshooting and limitations

  • Same filename, different checksum: names do not establish content identity. The vendor may have replaced the package; confirm the current reference before proceeding.
  • Wrong algorithm: compare SHA-256 with SHA-256. MD5 or SHA-1 values cannot be compared with a SHA-256 result; Microsoft warns that MD5 and SHA-1 are unsuitable against deliberate attacks.
  • No published hash: do not invent an expected value. Ask the vendor or your IT team for a trusted verification method.

These commands do not modify the download, so there is no file change to roll back. For easier filename checking, see how to show file extensions in Windows 11.

Sources

Topics:
Read next
November 21, 2026

How to Require MFA for Administrator Roles with Microsoft Entra Conditional Access

Protect privileged Microsoft Entra accounts by creating a report-only Conditional Access policy that requires MFA for built-in administrator roles, then safely moving it to On.
November 20, 2026

OpenAI Releases GPT-6.2 Astra and Sol as AI Competition Shifts to Workflow Economics

OpenAI has released GPT-6.2 Astra and Sol with lower API pricing and stronger professional-work claims. Early independent reactions are mixed, making task-level testing more important than benchmark headlines.