[Windows] Unify services handling (#8871)

* [Windows] Unify services handling

* Fix Set-Service usage
This commit is contained in:
Vasilii Polikarpov
2023-11-23 18:08:20 +01:00
committed by GitHub
parent 6efbc46fc7
commit 79c347765a
8 changed files with 21 additions and 102 deletions

View File

@@ -4,7 +4,7 @@
################################################################################
# Stop w3svc service
Stop-Service -Name w3svc | Out-Null
Stop-Service -Name w3svc
# Install latest nginx in chocolatey
$installDir = "C:\tools"
@@ -12,10 +12,10 @@ Install-ChocoPackage nginx -ArgumentList "--force", "--params", "/installLocatio
# Stop and disable Nginx service
Stop-Service -Name nginx
Set-Service nginx -StartupType Disabled
Set-Service -Name nginx -StartupType Disabled
# Start w3svc service
Start-Service -Name w3svc | Out-Null
Start-Service -Name w3svc
# Invoke Pester Tests
Invoke-PesterTests -TestFile "Nginx"