Comparing Hash of downloaded Files with PowerShell

2014/04/17

I can’t claim 99% of this – main credit to : http://www.tinyint.com/index.php/2011/09/14/get-an-md5-or-sha1-checksum-with-powershell/

)

$fs = new-object System.IO.FileStream $File, “Open”, “Read”, “Read”;
$algo = [type]"System.Security.Cryptography.$Algorithm"
$crypto = $algo::Create()
$hash = [BitConverter]::ToString($crypto.ComputeHash($fs)).Replace("-", "")
$fs.Close()
return $hash

More Posts