Title
#windows
Aman Kumar Chagti

Aman Kumar Chagti

11/28/2021, 7:07 AM
hi guys, how can download MSI package of Osquery from Powershell and also install it from Powershell itself.
Mystery Incorporated

Mystery Incorporated

11/28/2021, 4:46 PM
Hello, to download using powershell:
#Specify allowed protocols for our download, TLS 1.2+
$Protocols = [System.Net.SecurityProtocolType]'Tls12,Tls13'
[System.Net.ServicePointManager]::SecurityProtocol = $Protocols

#Download osquery
Invoke-WebRequest -Uri "<https://pkg.osquery.io/windows/osquery-5.0.1.msi>" -OutFile "C:\ProgramData\MyTempFolder\osquery.msi"
4:47 PM
And then to silent install the msi with powershell:
#Install osquery
msiexec /i C:\ProgramData\MyTempFolder\osquery.msi /quiet /qn /norestart /log C:\ProgramData\MyTempFolder\osquery_install.log