Change environment variable value between tasks in Build vNext

Question:

Is there a way to persist changes in environment value between tasks in Visual Studio Team Services? I’m using Powershell to change it but it only changes it in the task not the whole process.

script 1

script 2

I see the change at After but Final is always getting the original value

Answer:

Based on this issue following line will do the trick.

Write-Host ("##vso[task.setvariable variable=SuperVersion;]$NewVersion")

You may find more commands like that in here

Source:

Change environment variable value between tasks in Build vNext by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply