Commands for installing Policy 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 OpenPolicyContainers.Policy -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OpenPolicyContainers.Policy -e --silentwinget uninstall --id OpenPolicyContainers.Policy -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i policy_windows_amd64.msi /qn /norestartWrite a log
msiexec /i policy_windows_amd64.msi /qn /norestart /l*v "%TEMP%\policy-cli-install.log"Uninstall
msiexec /x {A19BAA0B-3D4E-4919-89D4-2197FCB11973} /qn /norestart- MSI product code
- {A19BAA0B-3D4E-4919-89D4-2197FCB11973}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A19BAA0B-3D4E-4919-89D4-2197FCB11973}
- UpgradeCode
- {AF677EAE-09B4-4080-AFE1-10DB43E0F103}
- Install folder
- %ProgramFiles%\Policy CLI
64-bit · ZIP
No installation needed (portable)
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-policy-cli.ps1
$url = 'https://github.com/opcr-io/policy/releases/download/v0.4.4/policy_windows_amd64.msi'
$sha256 = 'BE8B9A6F8A6929F851CBCC342FEAA1B64B900B8AED4169EB88202E381876C6D8'
$file = Join-Path $env:TEMP 'policy_windows_amd64.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