I have this PowerShell script, that reads some environment variables and outputs them:
Write-Host "name: $(tenantName) version: $(versionRelease) url: $(urlApplication)"
Those variables are defined as pipeline variables and also in variable groups in an Azure DevOps release pipeline.
When run inside a PowerShell task defined as Inline, this script works as expected. However, the same exact script won't work when the PowerShell task is configured with a File Path. In this case, the tenantName
env variable is not found:
tenantName : The term 'tenantName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Is there any way to make the environment variables available to a "File" script as they are to an "Inline" one?