Commands for installing InSpec 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 ChefSoftware.Inspec -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id ChefSoftware.Inspec -e --silentwinget uninstall --id ChefSoftware.Inspec -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i inspec-6.8.24-1-x64.msi /qn /norestartWrite a log
msiexec /i inspec-6.8.24-1-x64.msi /qn /norestart /l*v "%TEMP%\inspec-install.log"Uninstall
msiexec /x {4D44D753-F749-41C9-9FE9-6E70EA267E92} /qn /norestart- MSI product code
- {4D44D753-F749-41C9-9FE9-6E70EA267E92}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4D44D753-F749-41C9-9FE9-6E70EA267E92}
- UpgradeCode
- {DFCD452F-31E5-4236-ACD1-253F4720250B}
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-inspec.ps1
$url = 'https://packages.chef.io/files/stable/inspec/6.8.24/windows/8/inspec-6.8.24-1-x64.msi'
$sha256 = 'A4C095C1BF72DEE75C66F63F001A45306C256FDCD5220FAF7FBB71BA3CBC7AE7'
$file = Join-Path $env:TEMP 'inspec-6.8.24-1-x64.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