MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
444 stars 155 forks source link

Update azure devops release definition variable with Update-VSTeamReleaseDefinition - removes variable from definition #390

Closed dariuszbz closed 3 years ago

dariuszbz commented 3 years ago

I'm running the below script (vsteam 7.1.3)

$PAT ="-----------------------------"

Set-VSTeamAccount -account "https://dev.azure.com/xxx" -PersonalAccessToken $PAT

$releaseDef = Get-VSTeamReleaseDefinition -ProjectName yyy -ID 2 -Raw

$releaseDef.variables.ImageName = "abcd/jsj/laa:222"

$body = $releaseDef | ConvertTo-Json -Depth 100

Update-VSTeamReleaseDefinition -ProjectName LLCMS -ReleaseDefinition $body

Result: variable ImageName disappear from azure devops release pipeline definition.

Expected: The new value for ImageName variable setup in azure devop release pipeline definition.

dariuszbz commented 3 years ago

I use powershell and azure devops api., and it works.

DarqueWarrior commented 3 years ago

I use powershell and azure devops api., and it works.

If you run the command with -verbose it will dump data so you can compare what VSTeam is doing vs your code. Might help identify what is going on.

DarqueWarrior commented 3 years ago

@dariuszbz please let us know if this is still an issue or if we can close.

dariuszbz commented 3 years ago

Close. I use devops api now, and abandoned vsteam

On Mon, 17 May 2021, 18:06 Donovan Brown, @.***> wrote:

@dariuszbz https://github.com/dariuszbz please let us know if this is still an issue or if we can close.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MethodsAndPractices/vsteam/issues/390#issuecomment-842488209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVINAWOVHOIJEFCSP2JT2TTOFEHRANCNFSM427I5XEA .