Skip to content

YoBigRube/powershell-compare-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

powershell-compare-hash

Windows Powershell Script for Comparing Hash Values

USING THIS TOOL:

  1. Edit the PowerShell file named 'get-hash.ps1': you'll be editing two different variable's values.
  2. For the variable named $file: Update its value with the name & path to the file you want to compare hash values for. (eg. C:\example-directory-name\file-name.exe)
  3. For the variable named $providedHash: Update its value with the hash value provided by the vendor or download source. (eg. Will be a long alphanumeric string)
  4. Save the changes to your file.
  5. Open up a terminal window in Windows PowerShell
  6. Within your PowerShell terminal window you will run the script by referencing its file name. Type 'get-hash.ps1'
  7. Hit 'Enter' - This will run the script to compare the hash values.
  8. If the hash values match you will get a success message. If they do not match you will get a message that informs the values do NOT match.

A little bit about why I created this script and what it's for

I've got a ton of other repos, but this is actually my 1st public MIT licensed repository.

I created this repository and script because I didn't know much about hashes, checksums and all of that. I was trying to download an executable file from the web and wanted to compare the hash values.

I did several web searches for tools to do this, but had that feeling cause I didn't actually know any of the publishers for those GUI based apps.

Also, using the GUI tool would mean I wouldn't really know much more about the process than when I went into this.

I appreciate when I can do something myself cause the process always leaves me better educated than when I went into it.

So I set out and began learning about the topic in a deeper way.

Sometime later I had gotten to the point to write my first script.

I learned some PowerShell scripting along the way too - which was cool. Cause this is also my very first PowerShell script ever; which is a dope feelin' for me.

Anyway, I hope this script is helpful to someone else down the line. If you're liking it def let me know.

In time I hope to make it more robust and sophisticated as I've got time and the desire to. But, for now it's serving the purpose that originally moved me to do this in the first place.

You're going to need to set your execution policy.

If you're not familiar with setting your execution policy peep some info here setting execution policy | MSDN Microsoft: https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Execution_Policies to help you get up and running.

I've added an additional PowerShell script with example scripts for setting execution policy to help get ya started.

Resource Links

Links that helped me along the way. This list is reverse chronological order from how I found 'em. If you're new to this as I am/was, start at the bottom then work your way towards to top of the list:

Peace y'all. Reuben

About

Windows Powershell Script for Comparing Hash Values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published