Skillfully use Win10 's own PowerShell command to verify the hash value of the file (MD5, sha1/256, etc.)posted on March 8, 2017 by Ms Sheikh
Generally, in order to ensure the integrity and reliability of the files we download from the Internet, we will check the MD5 value or SHA1 value after downloading the file (for example, verifying that the downloaded WIN10 ISO image is the original file), which is usually done with a special MD5 inspection tool. However, you can perform file MD5, SHA1 value checking using Windows PowerShell running commands from Windows system. Here's how:
Right-click on the Win10 Start button and select Windows PowerShell (Administrator) to open the Administrator: Windows PowerShell window.
The command format for verifying the hash value of a file is as follows:
Get-filehash file path-algorithm checksum hash value type | Format-list
PS: If you need to verify the file path is more complex, such as the path contains spaces, parentheses and other special symbols, you need to precede the path with double quotation marks.
The types of hash values that Windows PowerShell commands can verify include: SHA1, SHA256, SHA384, SHA512, MACTripleDES, MD5, RIPEMD160, and the checksum CRC32 value is not supported at this stage.
If you do not have the-algorithm parameter, that is, the hash value type of the validation is not specified, then the default validation is the SHA256 value.
The following Ms Chief for example, to verify the system's Notepad program hash value for example, the path of the program file is C:\Windows\notepad.exe. If we want to verify its MD5 value, run the following command:
Get-filehash C:\Windows\notepad.exe-Algorithm md5| Format-list
If you want to verify its SHA1 value, run the following command:
Get-filehash C:\Windows\notepad.exe-Algorithm sha1| Format-list
If you want to verify the SHA256 value, you do not need to take the-algorithm parameter, the command is as follows:
Get-filehash C:\Windows\notepad.exe | Format-list
Win10 PowerShell verifies the MD5/SHA1 signature value of the downloaded package