In VSTS, I am using a PowerShell task to run one of my script. The script contains the following:
Write-Error 'error 1'
Write-Error 'error 2'
Since the Write-Error cmdlet writes on stderr, these messages get reported in the VSTS web interface:
I would like to improve on this output. The improvements that I am looking for is:
- I would like to have one red X per error.
- I would like to remove all the noise, i.e. get rid of the lines starting with '+'
Instead of calling Write-Error, is there another function that I can call from my script to add an error to the build summary page?
I saw the function Write-VstsTaskError but unfortunately it can only be called from a VSTS task. It cannot be called from my script.