1

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 Answer 1

3

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 .

Sign up to request clarification or add additional context in comments.

1 Comment

What do you do if the task name has spaces or dots?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.