Skip to content

Commit a5e70ef

Browse files
committed
fix(ci): set ChocolateyInstall env var default for pre-installed Chocolatey on Windows runners
On persistent Windows CI runners, Chocolatey is pre-installed by the base image and $env:ChocolateyInstall is not set. Add a fallback to the standard installation path before using the variable.
1 parent b7eb412 commit a5e70ef

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

dockerfiles/verify_packages/verify_windows.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# to run manually: docker run --rm -ti -v $pwd\..\..:c:\app -w c:\app chocolatey/choco:latest-windows powershell.exe .\dockerfiles\verify_packages\verify_windows.ps1
22

3+
if (-not $env:ChocolateyInstall) { $env:ChocolateyInstall = 'C:\ProgramData\chocolatey' }
34
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
45

56
choco install -y php

0 commit comments

Comments
 (0)