Wednesday, February 12, 2014

Quick Tip: File Hashes with PowerShell Community Extensions

Problem
I need to calculate the MD5 and SHA hashes for a file from Windows and I'd rather not download 3rd-party GUI software that clutters my setup.

Solution
I like the PowerShell Community Extensions for this.

  1. Download Chocolatey Nuget (it will make your life outside of this post easier, I promise).
  2. From the Powershell command prompt, type cinst pscx . This will install the PowerShellCommunity Extensions.
  3. Use the PSCX syntax to get the hashes. Some examples below:
Get-Hash C:\Path\To\File.zip -Algorithm MD5
Get-Hash C:\Path\To\File.zip -Algorithm SHA1