Create and apply value for variable dynamically
The two variables defined in following PowerShell script var and var2 are dynamically created and assigned with values chaminda and chandrasekara respectively.
This kind of scenario can be used to obtain Variables via Octopus deploy variable sets attached to an Octopus deploy project, to reuse them in Azure DevOps pipeline. Example below and full post on this usage can be found here.
Write-Host ("##vso[task.setvariable variable=" + $octopusVariable.Name + "]" + $variableValue)
Use the dynamic variables in other tasks/steps
The variables can be used normally as you use the other variables defined in the variable groups or in the definition itself.
The variables effectively working and the values are available in the dynamically created variables.
No comments:
Post a Comment