Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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]"


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

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)"

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories