We are implementing a naming convention for our release pipelines. It follows this format:
Priority.Team.Product
Some of our release pipelines are already in the format Priority.Team.Product and no changes are necessary. Others are named Team.Product and I need to add the Priority. prefix to make the names compliant.
To do this, I created a new task group variable "Priority.ReleaseDefinitionName". Its default value is $(Release.DefinitionName)
.
In a PowerShell script task with an inline script, I check to see if the Priority. is present or missing and change the name accordingly in a local variable called $name
.
At the end of the script, I try to set Priority.ReleaseDefinitionName
to the value of $name
this way:
Write-Host "##vso[task.setvariable variable=Priority.ReleaseDefinitionName;]$name"
Unfortunately, this is not working. The variable name remains unchanged in the subsequent tasks. The value of $name
is correct but the value of $(P1.ReleaseDefinitionName)
is not.
What am I missing?
I tried using the following code to set the variable name:
Write-Host "##vso[task.setvariable variable=Priority.ReleaseDefinitionName;]$name"
Expected result is the value of $(Priority.ReleaseDefinitionName)
has been changed to the value of $name
in subsequent tasks.
Acutal result is the value of $(Priority.ReleaseDefinitionName)
remains unchanged.