Skip to content

Instantly share code, notes, and snippets.

@kventil
kventil / gist:cdd1054f51465c3b52b6
Created May 26, 2015 08:04
get md5-hash (Supports filesize > 2GB but is very slow!)
function md5hash($path)
{
$fullPath = Resolve-Path $path
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$file = [System.IO.File]::Open($fullPath,[System.IO.Filemode]::Open, [System.IO.FileAccess]::Read)
[System.BitConverter]::ToString($md5.ComputeHash($file))
$file.Dispose()
}