How to fail the build from a PowerShell task in TFS 2015

I’ve created a very simple script: Write-Error (“Some error”) exit 1 Save this as a PowerShell script. Create a new Empty Build definition and only add one PowerShell task that points to your script. When I do this I get a failed build with the following error: 2015-12-30T10:27:29.4872452Z . ‘C:\a\1\s\script.ps1’ 2015-12-30T10:27:29.6780242Z Executing the following powershell … Read more