Commands for installing AWS CloudHSM CLI without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Amazon.AWSCloudHSM.CLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Amazon.AWSCloudHSM.CLI -e --silentwinget uninstall --id Amazon.AWSCloudHSM.CLI -e --silentBy installer
64-bit · MSI · Current user · en-US
Silent install
msiexec /i AWSCloudHSMCLI-5.18.0-1.msi /qn /norestartWrite a log
msiexec /i AWSCloudHSMCLI-5.18.0-1.msi /qn /norestart /l*v "%TEMP%\aws-cloudhsm-cli-install.log"Uninstall
msiexec /x {2DF94E11-3214-4949-9528-F4E6E886DDCE} /qn /norestart- MSI product code
- {2DF94E11-3214-4949-9528-F4E6E886DDCE}
- Uninstall registry key
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2DF94E11-3214-4949-9528-F4E6E886DDCE}
- UpgradeCode
- {0A0A245A-A0B8-4E01-8041-4455A6D24832}
- Install folder
- %ProgramFiles%/Amazon/CloudHSM
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-aws-cloudhsm-cli.ps1
$url = 'https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/Windows/AWSCloudHSMCLI-5.18.0-1.msi'
$sha256 = 'B536E61880080695DC705234EB45ABEF5F34BC20273AE9CDCA25ACF9163D86A6'
$file = Join-Path $env:TEMP 'AWSCloudHSMCLI-5.18.0-1.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait