Check File Hash with PowerShell (Get-FileHash) (2024)

In this guide, you will learn how to check a file hash value using PowerShell.

This will work on any file type, exe, msi, docx, pdf, iso, and so on.

A file hash is a unique value that corresponds to the content of the file.

Checking a file hash value is often used when downloading files from the internet and you want to verify the integrity of the file (it has not been modified). Some websites will post the hash value of the file and after downloading it you can check the hash value to verify it matches.

If the hash is different, then the file has been modified or is corrupt.

How to Check File Hash?

You can check the hash value for a file by using the PowerShell command get-filehash and the path to the file. In the example below, I’m getting the hash value for a file called test.docx on my local computer. By default, this command used the SHA256 algorithm.

get-filehash c:\it\test.docs

Here is a screenshot from my local computer.

Check File Hash with PowerShell (Get-FileHash) (1)

The hash is based on the contents of the file. If the contents of the file change, then the hash will change. I’ll demonstrate this by opening the document and adding the words “added text to document”.

Check File Hash with PowerShell (Get-FileHash) (2)

Now if I run the get-filehash command again you will see that the hash value has changed.

Check File Hash with PowerShell (Get-FileHash) (3)

If you rename the file or change the file extension the hash value will not change, again this is because the hash is calculated based on the contents of the file, not the filename or extension.

What is the Importance of a Hash Value?

You now know how to check the hash value but how does this help you? Software developers sometimes list the hash value of a file on their website, this will help you verify the file’s integrity.

The purpose of publishing the hash is so you know the file you are downloading is from the developer and has not been modified.

I’ll walk you through a real-world example.

On my website, I offer a free trial download and post the hash value of the file.

Check File Hash with PowerShell (Get-FileHash) (4)

After downloading you can run the get-filehash command on the msi file to check its integrity. (make sure it has not been altered).

Check File Hash with PowerShell (Get-FileHash) (5)

You can see in the above screenshot the downloaded file has the same hash value as displayed on my website. This lets you know the contents of the file have not been modified. If a hacker had injected code into the file, then the hash value would have changed and would not match what I posted on my website.

Hash values are also used in various security products like firewalls, IDS, endpoint protection software, and so on. If one of these programs detects a file is malicious, then it can be blocked based on the hash of the file. This is important because the file could be named after a legitimate windows file like cmd.exe or svchost.exe. These are actual file names of real programs on a Windows computer.

But the malicious file would have a different hash value from the legitimate file on a computer, this would allow you to block the malicious file based on the hash.

Check File Hash with PowerShell (Get-FileHash) (2024)
Top Articles
Hard drive or full disk encryption explained
What Is The Holy Grail In Trading? (Holy Grail Trading Strategy)
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Umn Biology
Obituaries, 2001 | El Paso County, TXGenWeb
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Colin Donnell Lpsg
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
San Pedro Sula To Miami Google Flights
Selly Medaline
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 6212

Rating: 4.8 / 5 (58 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.