Skip to content

Commit 8646bf1

Browse files
authored
Merge pull request #380 from redhatrises/win_uninstall
fix: use regex for uninstaller name and search results by regex
2 parents 22dfb59 + 12bf42d commit 8646bf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

powershell/install/falcon_windows_uninstall.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ process {
382382
$UninstallerPath = $null
383383
switch ($UninstallTool) {
384384
'installcache' {
385-
$UninstallerName = 'WindowsSensor*.exe'
385+
$UninstallerName = '(WindowsSensor*.exe|FalconSensor_Windows*.exe)'
386386
$UninstallerPathDir = 'C:\ProgramData\Package Cache'
387387

388388
if (Test-Path -Path $UninstallerPathDir) {
389-
$UninstallerPath = Get-ChildItem -Include $UninstallerName -Path $UninstallerPathDir -Recurse | ForEach-Object { $_.FullName } | Sort-Object -Descending | Select-Object -First 1
389+
$UninstallerPath = Get-ChildItem -Path $UninstallerPathDir -Recurse | Where-Object { $_.Name -match $UninstallerName } | ForEach-Object { $_.FullName } | Sort-Object -Descending | Select-Object -First 1
390390
} else {
391391
$UninstallerPath = $null
392392
}

0 commit comments

Comments
 (0)