PowerShell is a weird mix of .bat and .NET. In .bat, you check errorlevel and stderr output from commands. In .NET, you catch exceptions.
How do cmdlets return errors? Do they throw exceptions when they fail or do they set $? instead? Is this configurable?
I also assume that .NET functions I call in PowerShell will always throw exceptions and not get automatically caught by the shell and converted into errors. Is that correct?
Maybe what I really ought to ask is: what's a good article that goes over all of this? Seems like a lot of engineers out there like me who have experience in cmd's .bat and .NET both are wondering exactly how we ought to be doing things in this brave new world of Posh.