Fix Logitech G Hub scripts

This commit is contained in:
Manuel Thalmann 2024-03-24 13:47:53 +01:00
parent eaa4d5f7d2
commit be052f8b2f

View file

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