2
Function Get-FileSHA256{
7
$hash = [Security.Cryptography.HashAlgorithm]::Create( "SHA256" )
8
$stream = ([IO.StreamReader]$FilePath).BaseStream
9
$res = -join ($hash.ComputeHash($stream) | ForEach { "{0:x2}" -f $_ })
12
} catch [System.Management.Automation.RuntimeException] {
13
return (Get-FileHash -Path $FilePath).Hash