mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Adding checks for chocolatey install (#2978)
This commit is contained in:
parent
0e57003e74
commit
f9e13060b4
@ -13,6 +13,16 @@ $destClientBin = Join-Path $targetFolder 'osqueryi.exe'
|
||||
$packageParameters = $env:chocolateyPackageParameters
|
||||
$arguments = @{}
|
||||
|
||||
# Before modifying we ensure to stop the service, if it exists
|
||||
if ((Get-Service $serviceName -ErrorAction SilentlyContinue) -and (Get-Service $serviceName).Status -eq 'Running') {
|
||||
Stop-Service $serviceName
|
||||
}
|
||||
|
||||
# Lastly, ensure that the Deny Write ACLs have been removed before modifying
|
||||
if (Test-Path $daemonFolder) {
|
||||
Set-DenyWriteAcl $daemonFolder 'Remove'
|
||||
}
|
||||
|
||||
# Now parse the packageParameters using good old regular expression
|
||||
if ($packageParameters) {
|
||||
$match_pattern = "\/(?<option>([a-zA-Z]+)):(?<value>([`"'])?([a-zA-Z0-9- _\\:\.]+)([`"'])?)|\/(?<option>([a-zA-Z]+))"
|
||||
|
Loading…
Reference in New Issue
Block a user