/
Create SHA-256 Hash for File in PowerShell

Create SHA-256 Hash for File in PowerShell

The following commands allow you to create the SHA-256 hash for a file, in Base 64 format, in PowerShell. This can be compared to the hash stored by Foray ADAMS® for a file, less the “SHA256” prefix.

PowerShell - all versions

[System.Convert]::ToBase64String([byte[]] -split ((Get-FileHash "<FILE_PATH>").Hash -replace '..', '0x$& '))

Example: