Home / Microsoft / PowerShell File Hash Calculator Script

PowerShell File Hash Calculator Script

File Hash Calculator in PowerShell

This File Hash Calculator Script in PowerShell lets you calculate a hash of a given file and compares it with the original hash/checksum the user provides.

The Get-FileHash cmdlet computes the hash value for a file by using a specified hash algorithm. A hash value is a unique value that corresponds to the content of the file. Rather than identifying the contents of a file by its file name, extension, or other designation, a hash assigns a unique value to the contents of a file.

Simply execute the Script and follow the Steps for the hash calculation and verfication by choosing the menu point. You will have to provide a path to the file you want to calculate and you will have to paste the original hash/checksum to compare it. Currently this script supports every method which the cmdlet Get-FileHash supports.

  • MACTripleDES
  • MD5
  • RIPEMD160
  • SHA1
  • SHA256
  • SHA384
  • SHA512

Simply execute the Script in a opened up PowerShell.

PowerShell File Hash Calculator Script Execution of the Script

After executing the script you will be presented a menu to choose which algorithm you want to calculate.

PowerShell File Hash Calculator Script Script Menu

If you are calculating big files, the Script will show a progress bar, so you know the file is beeing calculated.

PowerShell File Hash Calculator Script Image of the progess bar

The Script will tell you if your file and the provided checksum is valid or not.

Example of a valid hash:

PowerShell File Hash Calculator Script Image of a valid hash

Example of a non valid hash:

PowerShell File Hash Calculator Script Image of a non valid hash

The script also checks for a correct user input. If the file doesn’t exist which the user provides, it throws an error message.

Missing Input File

Have fun with the File Hash Calculator Script in PowerShell ! I always love feedback, so write a comment or leave me a message on social media.

You can get the Script on my Github Page: File Hash Calculator Script

Here is the link to the Get-FileHash Command on the Microsoft docs page

Check Also

Office365_Veeam

New Features in Veeam Backup for Office 365 v3 BETA

General Information On Wednesday the 13th, Veeam released the public Beta for Veeam Backup for …

Leave a Reply

Your email address will not be published. Required fields are marked *