1
votes

I have a Task Group with a PowerShell task. This task returns variables as outputs. In my pipeline I have two tasks after this Task Group task:

  • One that is an ARM deployment task: I'm able to retrieve the content of the output variables from the PowerShell (with the "$(variablename)" syntax)
  • One that is another Task Group with a PowerShell task in it. When I pass the "$(variableName)" token as an input parameter for this task, it is not interpreted. In the PowerShell script I received the string "$(variableName)", and not the value of the variable itself...

Am I missing something?

1

1 Answers

3
votes

Using ##vso syntax to set the output variable in the first task group.

Write-Host "##vso[task.setvariable variable=var1;isOutput=true;]test"

enter image description here

In the subsequent tasks or task group, get the variable in the form of task name + ordinal combination. e.g. $(Powershell1.VariableName)

enter image description here

enter image description here

enter image description here

You can refer to this ticket with similar issue .