Compare-FortiOSHash is a PowerShell script that compares the hash of a downloaded FortiOS .out file with a hash provided by Fortinet. It supports both MD5 and SHA512 hashes, and can check a TXT or XML file for the hash or take input from the command line. It also checks the name of the downloaded file to make sure it matches the provided name. The hashes are displayed side by side in all caps for easy comparison.
To use the script, run Compare-FortiOSHash.ps1 in PowerShell with the following parameters:
-FilePath(mandatory): the path to the downloaded file.-Hash(optional): the hash provided by Fortinet. Can be provided via command line input or checked from a TXT or XML file.-Algorithm(optional): the hash algorithm to use. Supports MD5, SHA512, or both.-Name(optional): the expected name of the downloaded file.
For example: Compare-FortiOSHash.ps1 -FilePath C:\Downloads\file.out -Hash ABCDEF123456 -Algorithm SHA512 -Name file.out
The script includes version and author information in its documentation.
The script requires PowerShell 5.1 or later.
This script is licensed under the MIT License.
Contributions are welcome! Please feel free to open issues or submit pull requests.
This script was created by Gabriel Jensen.