Created
May 16, 2024 17:51
-
-
Save CodeMan99/cf27c2761c13d0235231cfc4db067165 to your computer and use it in GitHub Desktop.
Validating a SHA256 Checksum in PowerShell
This file contains 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
PS E:\Images> $rocky_hash = Get-FileHash -Path .\Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz -Algorithm sha256 | % {$_.Hash} | |
PS E:\Images> Get-Content -Path .\Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz.CHECKSUM | |
# Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz: 44455204 bytes | |
SHA256 (Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz) = 1fbec9bfd250752325106e1a3fefc022067731f3b19129cbeb8907ff606fe0e2 | |
PS E:\Images> $rocky_hash -eq "1fbec9bfd250752325106e1a3fefc022067731f3b19129cbeb8907ff606fe0e2" | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment