I am following this link to set a variable in a task such that it can be used in another task in the same agent job.
In a PowerShell script task I am using the foll. line to set variable:
Write-Host "##vso[task.setvariable variable=sauce]crushed tomatoes"
The next section on the link shows how to read variable - it has got arguments and script. Where do I have to enter the arguments? Is it into another powershell task? This next part suggests that I also need to set
isOutput=true
when the variable needs to be used by another task - https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch#using-variables-as-task-inputsI am confused between accessing the variable set in above step. If I want to fetch the value in another PowerShell task or if I want to pass the value to another non-powershell task, then should I use
$(sauce)
or$env:SAUCE
to fetch/send the value?