Commands for installing osquery 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 osquery.osquery -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id osquery.osquery -e --silentwinget uninstall --id osquery.osquery -e --silentBy installer
64-bit · MSI · All users · en-US
Silent install
msiexec /i osquery-5.24.0.msi /qn /norestartWrite a log
msiexec /i osquery-5.24.0.msi /qn /norestart /l*v "%TEMP%\osquery-install.log"Uninstall
msiexec /x {C31D86CB-6E56-4661-A798-3DCC57A6EEC7} /qn /norestart- MSI product code
- {C31D86CB-6E56-4661-A798-3DCC57A6EEC7}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C31D86CB-6E56-4661-A798-3DCC57A6EEC7}
- UpgradeCode
- {EA6C7327-461E-4033-847C-ACDF2B85DEDE}
- Install folder
- %ProgramFiles%/osquery
- DisplayVersion
- 5.24.0
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-osquery.ps1
$url = 'https://github.com/osquery/osquery/releases/download/5.24.0/osquery-5.24.0.msi'
$sha256 = '5F123C07936EE927D7B44CCDAF5D01C4B9BAB2956328A4D8C7ADC3395812A659'
$file = Join-Path $env:TEMP 'osquery-5.24.0.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