Validating Hashes with PowerShell

May 25, 2018

I really enjoy the “do one thing and do it well” philosophy of Unix tools. With PowerShell, we can often accomplish the same as many of these tools, but it’s a bit more verbose.

Here’s how to compare file hashes:

(Get-FileHash -Algorithm MD5 -Path C:\hello.txt).Hash -eq 'a2cbdf344ede757bfcde9d9b3a48e90b'

Supported algorithms are: