Get Hash Value – PowerShell

Hey Friends,

In one of my development in BC I was supposed to get the Hash value of all the file types. Here is the quick to get it out and use into your Application.

$signature = Get-FileHash -Path “Complete path” -Algorithm SHA256
$signatureBytes = [byte[]] -split ($signature.Hash -replace ‘..’, ‘0x$& ‘);
$signatureBase64 = [System.Convert]::ToBase64String($signatureBytes);
$signatureBase64

Algorithm value you can change as per need.

CHEERS