Azure DevOps在发布阶段之间无法传递参数

时间:2019-08-30 13:15:34

标签: azure-devops azure-devops-rest-api

我有发布管道,我想从阶段1到阶段2进行更改,但只能将其保留在此特定版本中,而不修改版本定义。

1 个答案:

答案 0 :(得分:1)

第一阶段

Install-Module VSTeam -Scope CurrentUser -Force
Set-VSTeamAccount –Account $(Acct) -PersonalAccessToken $(PAT)
Get-VSTeamRelease -ProjectName "$(System.TeamProject)" -Id $(Release.ReleaseId) -Raw
$r.variables.test.value = 'Set In Stage 1'
$r.variables | Add-Member NoteProperty temp([PSCustomObject]@{value='Created in Stage 1'})
Update-VSTeamRelease -ProjectName "$(System.TeamProject)" -Id $(Release.ReleaseId) -Release $r -Force

第2阶段

Write-Host $(Test)
Write-Host $(Temp)

发现于 http://donovanbrown.com/post/Passing-variables-from-stage-to-stage-in-Azure-DevOps-release