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: Let your task fail.
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
Let your Inline Powershell task fail
Sometimes you have to fail your build or release. In your Inline Powershell task you have 2 options in bow to do this. The first option in with a ‘exit 1’, the second option is vso command.
Write-Host "##vso[task.complete result=Failed;]DONE"
You have to following options as result value for your task: