Kill all processes related to LGHub during restore

This commit is contained in:
Manuel Thalmann 2024-03-24 17:47:41 +01:00
parent 32e29c5c03
commit aaf1eab21b

View file

@ -17,7 +17,7 @@ $null = New-Module {
$hubName = Get-LogitechGHUBName;
$lghubPath = $(Get-Process | Where-Object { [System.IO.Path]::GetFileName($_.Path) -eq $hubName })[0].Path;
$mainProcesses = Get-Process | Where-Object { @($hubName) -contains [System.IO.Path]::GetFileName($_.Path) -and $(
$mainProcesses = Get-Process | Where-Object { @("lghub_agent.exe", $hubName) -contains [System.IO.Path]::GetFileName($_.Path) -and $(
$_.Parent.ProcessName -eq "explorer" -or $null -eq $_.Parent) };
$null = $mainProcesses | Foreach-Object { $_.Kill($true) };