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() } }