diff --git a/images/macos/scripts/tests/WebServers.Tests.ps1 b/images/macos/scripts/tests/WebServers.Tests.ps1 index a132ba06f..18c6bbb26 100644 --- a/images/macos/scripts/tests/WebServers.Tests.ps1 +++ b/images/macos/scripts/tests/WebServers.Tests.ps1 @@ -8,7 +8,8 @@ Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) { } It "Apache Service" { - brew services list | Out-String | Should -Match "httpd\s+(stopped|none)" + $service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "httpd" } + $service.status | Should -Match "(stopped|none)" } } @@ -18,6 +19,7 @@ Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma) { } It "Nginx Service" { - brew services list | Out-String | Should -Match "nginx\s+(stopped|none)" + $service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "nginx" } + $service.status | Should -Match "(stopped|none)" } }