Skip to content

Instantly share code, notes, and snippets.

@CodeMan99
Created May 16, 2024 17:51
Show Gist options
  • Save CodeMan99/cf27c2761c13d0235231cfc4db067165 to your computer and use it in GitHub Desktop.
Save CodeMan99/cf27c2761c13d0235231cfc4db067165 to your computer and use it in GitHub Desktop.
Validating a SHA256 Checksum in PowerShell
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