Files
runner-images/images/windows/scripts/build/Install-Nginx.ps1
T

28 lines
846 B
PowerShell
Raw Normal View History

2021-02-01 06:03:49 -08:00
################################################################################
## File: Install-Nginx.ps1
## Desc: Install Nginx
################################################################################
# Stop w3svc service
$w3svcService = Get-Service -Name "w3svc" -ErrorAction SilentlyContinue
if ($w3svcService) {
Stop-Service $w3svcService
}
2021-02-01 06:03:49 -08:00
# Install latest nginx in chocolatey
$installDir = "C:\tools"
Install-ChocoPackage nginx -ArgumentList "--force", "--params", "/installLocation:$installDir /port:80"
2021-02-01 06:03:49 -08:00
# Stop and disable Nginx service
Stop-Service -Name nginx
2023-11-23 18:08:20 +01:00
Set-Service -Name nginx -StartupType Disabled
2021-02-01 06:03:49 -08:00
# Start w3svc service
$w3svcService = Get-Service -Name "w3svc" -ErrorAction SilentlyContinue
if ($w3svcService) {
Start-Service $w3svcService
}
2021-02-01 06:03:49 -08:00
# Invoke Pester Tests
Invoke-PesterTests -TestFile "Nginx"