$file = 'd:\scripts\PSFile.ps1'
$sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider
[System.BitConverter]::ToString( $sha1.ComputeHash([System.IO.File]::ReadAllBytes($file)))
<# Useful Comments:
If the File size is more than 2 GB , you will get Exception calling "ReadAllBytes" with "1" argument(s): "The file is too long. This operation is currently limiited to supporting files less than 2 gigabytes in size."
It's better to use File.OpenRead instead of trying to load the entire file into memory at once. HashAlgorithm.ComputeHash has an overload for Stream.
#>