Build event - Create AS error with powershell

Hello community,
I would like to display an error message from a PowerShell script in the AS log during the post-build event. Using “Write-Warning,” the message is correctly displayed as a warning in the AS log. However, if I use “Write-Error,” it is displayed as a regular message and therefore not added to the error counter (which can be evaluated when triggering a build using the AS console application).

Note: The post-build event is only executed via a normal “Build” if specific conditions are met (see Help GUID: db8e9ccb-f4dd-48c7-9e16-96ee9f2089e9 → “Build events” tab).

AS version: 4.12

Thank you very much

Okay, easy solution:

Warning:
Write-Output "Warning: <Insert your message here>”
Error:
Write-Output "Error: <Insert your message here>”

1 Like

Hello,
Cool that you could solve it on your own so fast. Can you mark your Post as “Solution” its in the lower section were you can Reply or give Likes.

Thanks
Michael