7 lines
319 B
PowerShell
7 lines
319 B
PowerShell
function Get-FileBowSha256([string]$Path) {
|
|
$stream = [IO.File]::OpenRead([IO.Path]::GetFullPath($Path))
|
|
$algorithm = [Security.Cryptography.SHA256]::Create()
|
|
try { return [BitConverter]::ToString($algorithm.ComputeHash($stream)).Replace('-', '') }
|
|
finally { $algorithm.Dispose(); $stream.Dispose() }
|
|
}
|