本文介绍了在Build vNext中的任务之间更改环境变量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在Visual Studio Team Services中的任务之间保留环境值的更改?我正在使用Powershell进行更改,但它只会在任务中更改它,而不是整个过程.
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.
Write-Verbose "Before: $Env:SuperVersion"
$Env:SuperVersion = $NewVersion
Write-Verbose "After: $Env:SuperVersion"
脚本2
Write-Verbose "Final: $Env:SuperVersion"
我在之后看到了更改,但是最终总是得到原始值
I see the change at After but Final is always getting the original value
推荐答案
基于此问题可以解决问题.
Based on this issue following line will do the trick.
Write-Host ("##vso[task.setvariable variable=SuperVersion;]$NewVersion")
这篇关于在Build vNext中的任务之间更改环境变量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!