Reputation: 511
I am trying to pass PowerShell variable to an Azure Devops variable in pipeline during runtime but unable to pass them successfully. Could someone guide the correct syntax to apply escape sequence?
Azure devops pipeline variable:-
foo_ABC = abcdefghigklmnopqrstxyz
env= abc
Powershell task in pipeline:-
$environment= "$(env)".ToUpper()
$temp= "foo_$($environment)"
Write-Output "$($temp)"
Output:-
Expected: abcdefghigklmnopqrstxyz
Actual: (foo_ABC)
Upvotes: 0
Views: 222
Reputation: 19491
For this issue , the value of nested variables (like $($temp) are not yet supported in the pipelines. You can refer to this case to see this point.
As a workaround, you can try to use the Variable Toolbox task.
You can refer to this case for this task.
Upvotes: 1