Maximize how you use your VSTS build and release pipeline with Inline Powershell tasks. In this blog series ‘Tips and Tricks for Inline Powershell’, I will show simple samples on how to get more out of your pipelines. This blog post: Set the buildnumber.
VSTS Inline Powershell task
The Inline PowerShell VSTS task enables you to execute PowerShell from a textbox within your build or release pipeline. You can run a PowerShell script on you agent or as Azure Powershell.
Introduction Inline Powershell Task
Install Inline Powershell Task
Set the buildnumber
In some cases you want to have a custom buildnumber for your build. It is very simple to set the buildnumber from Powershell. The build.updatebuildnumber command let you set the buildnumber for the current build.
More tips and tricks
Use VSTS variables
Let your task fail
VSTS Command overview
Call a WebHook
Download a file
Install a Powershell Module
Navigate VSTS as filesystem
Make VSTS API Rest calls
Script example: Act on failed build
The above sample code updates the buildnumber to: 126.96.36.199