1

I have a pipeline that runs an agentless job. This job produces a result that I would like to pass to the next or next job. The problem is that all the examples I've found set variables on agent jobs, not agentless. See here, all the examples use script commands, which need to be run on an agent.

Is there a way to set an output variable from an agentless job? How else can I pass the result from an agentless job to the next?

Sunny-Dee
  • 87
  • 9

1 Answers1

1

Setting output variables from agentless jobs isn't supported

powershell runs Windows PowerShell and will only work on a Windows agent.

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops

Depending on what your use-case is, you may be able to use dependsOn and condition in your jobs to achieve your goal. E.g. for retries for builds that are not idempotent. Otherwise an agent-based configuration may be needed.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Max B
  • 66
  • 3
  • Unfortunately, I need to pass a value to the next task. If it would be a pass-fail type of step, a `dependsOn` would work. – Sunny-Dee Dec 07 '21 at 04:50