From cb3f1150db9f0787a47e69065b70e290c0e4dbed Mon Sep 17 00:00:00 2001 From: sergei-pyshnoi <121864472+sergei-pyshnoi@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:49:24 +0200 Subject: [PATCH] [Windows] Update google updater service name parser (#9738) --- images/windows/scripts/build/Install-Chrome.ps1 | 2 +- images/windows/scripts/tests/Browsers.Tests.ps1 | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/images/windows/scripts/build/Install-Chrome.ps1 b/images/windows/scripts/build/Install-Chrome.ps1 index ff420791dd81..6fe140f3c113 100644 --- a/images/windows/scripts/build/Install-Chrome.ps1 +++ b/images/windows/scripts/build/Install-Chrome.ps1 @@ -12,7 +12,7 @@ Install-Binary ` Write-Host "Adding the firewall rule for Google update blocking..." New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe" -$googleServices = @('gupdate', 'gupdatem') | Get-Service +$googleServices = Get-Service -Name "GoogleUpdater*" Stop-Service $googleServices $googleServices.WaitForStatus('Stopped', "00:01:00") $googleServices | Set-Service -StartupType Disabled diff --git a/images/windows/scripts/tests/Browsers.Tests.ps1 b/images/windows/scripts/tests/Browsers.Tests.ps1 index b92d20083a3e..21b30d6f59e1 100644 --- a/images/windows/scripts/tests/Browsers.Tests.ps1 +++ b/images/windows/scripts/tests/Browsers.Tests.ps1 @@ -28,14 +28,11 @@ Describe "Chrome" { $versionInfo | Should -Not -BeNullOrEmpty } - It "gupdate service is stopped" { - $svc = Get-Service -Name gupdate - $svc.Status | Should -BeExactly Stopped - } - - It "gupdatem service is stopped" { - $svc = Get-Service -Name gupdatem - $svc.Status | Should -BeExactly Stopped + It "GoogleUpdater services is stopped" { + $services = Get-Service -Name "GoogleUpdater*" + foreach ($svc in $services) { + $svc.Status | Should -BeExactly 'Stopped' + } } It "BlockGoogleUpdate firewall rule exists" {