Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (45.3k points)

I would like to update the Build.BuildNumber variable from a powershell script as a build step.

I've tried:

Write-Host "##vso[task.setvariable variable=BUILD_BUILDNUMBER]1.2.3.4"

and

Write-Host "##vso[task.setvariable variable=Build.BuildNumber]1.2.3.4"

This has not worked.

1 Answer

0 votes
by (16.8k points)

You'd need to use the Update Build Number function:

Write-Host "##vso[build.updatebuildnumber]1.0.0.$($env:Build_BuildId)"

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...