Created
September 16, 2021 14:01
-
-
Save jordanrobot/440c087f3551302d3c6d236101ece1bc to your computer and use it in GitHub Desktop.
Compares the hashes of two files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| [string]$fileA, | |
| [string]$fileB | |
| ) | |
| if ((!($fileA)) -or (!(Test-Path $fileA -PathType Leaf))) | |
| {$fileA=Read-Host "Enter First File to Compare"} | |
| if ((!($fileB)) -or (!(Test-Path $fileB -PathType Leaf))) | |
| {$fileB=Read-Host "Enter Second File to Compare"} | |
| if((Get-FileHash $fileA).hash -ne (Get-FileHash $fileB).hash) | |
| {"files are different"} | |
| Else {"Files are the same"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment