GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community
Windows builder : Environment variables not accessible in powershell script
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 848
- PR merge metrics
- No merged PRs in 30d
Description
## Affected builder image
https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/windows-builder
## Expected Behavior
Environment variable values set in cloudbuild.yml must be accessible inside PowerShell script
## Actual Behavior
Environment variables does seem to be set inside the container.
## Steps to Reproduce the Problem
cloudbuild.yaml content
```YAML
- name: 'gcr.io/$PROJECT_ID/windows-builder'
args: [ '--command', 'powershell.exe -file build.ps1' ]
env:
- 'ZONE_VALUE=test_var_value'
```
Expected `ZONE_VALUE` to be printed, but looks like it is not set.
```
Get-ChildItem Env:
echo $env:ZONE_VALUE
```
However, I can see it in execution details -

Contributor guide
Assessment
This issue has not been assessed yet.