Tag Archives: md5

Get MD5 Hash of a file via PowerShell/Windows

Want to check the hash of a huge file you downloaded on your shady network and have a machine running powershell? Then you are in luck!

Execute the following script to output the hash of the file you want to validate:

$FilePath = "c:\Users\MyAwesomeUser\Desktop\myreallybigfilethatisprobablyaniso.iso"
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($FilePath)))
Write-Host $hash.Replace("-","")

Hope this helps!