David GROSPELIER
David GROSPELIER

Reputation: 832

Azure DevOPS PowerShell task output and input parameters

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:

Am I missing something?

Upvotes: 1

Views: 1951

Answers (1)

Hugh Lin
Hugh Lin

Reputation: 19361

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 .

Upvotes: 3

Related Questions