hash command calculates the SHA256 hash of an installer file, which is required for WinGet package manifests.
Syntax
Required Arguments
Path to installer file
Options
File path (alternative to positional argument)
Also calculate SignatureSha256 for MSIX packages
Examples
Hash an installer:Output Format
Standard Installer
MSIX Package
With--msix flag:
Use Cases
Creating Manifests
When creating WinGet manifests:Verifying Downloads
Verify installer integrity:MSIX Packages
For MSIX packages, get both hashes:Hash Format
SHA256 hashes are:- 64 hexadecimal characters
- Case-insensitive
- Used for installer verification
Error Handling
File Not Found
MSIX Signature Error
Integration with Manifests
Use hash output directly in manifests:Exit Codes
0- Success0x80070002- File not found0x8A150041- MSIX signature extraction failed
The hash command reads the entire file to calculate the hash, which may take time for large installers.
For MSIX packages, the
--msix flag is required to extract the SignatureSha256, which is mandatory in WinGet manifests.