How can I display a 'naked' error message in PowerShell without an accompanying stacktrace?
问题 How can I write to standard error from PowerShell, or trap errors such that: An error message is displayed as an error (truly writing to standard error so that TeamCity and Octopus see it as an error) No stack trace garbage muddles my beautiful, concise error message All these years I've survived by throw ing errors or writing via Write-Error , but I'm tired and old, and in my scripts I just want to see one concise error message. I've been trying every combination of trap , throw , Write