Does it have automatic error handling, so that if one command fails, the whole script fails too? Last time I tried it, I needed to write
if ($LastExitCode -ne 0)
after each command.Does it have automatic error handling, so that if one command fails, the whole script fails too? Last time I tried it, I needed to write
if ($LastExitCode -ne 0)
after each command.
Yes, since 7.3. But in that typical verbose and awkward PowerShell way. My quip about PowerShell is that if they called it PowerScript, you'd realize it was bad Python.
Great tool for Windows admins who haven't realized they can write quick and dirty C# scripts cross platform for a decade now.