I have Azure DevOps release pipeline job having 4 tasks inside it.
I would like to set the environment variable in the first task and to use that value as input to the second task for parameter: Display name.
We can assume all 4 steps are PowerShell scripts.
Task 1 Powershell:
Write-Host "##vso[task.setvariable variable=myvariable;]abcdefg"
Task 2 Powershell:
PowerShell inside task 2:
Write-Host "$(myvariable)"
How could I set a variable in task 1 and access it as an input variable to task2?
My output was:
Task2 - $(myvariable) as display name
but PowerShell script itself output was:
abcdefg