We are all adult rumors about the two types of errors that PowerShell has: terminating and non-ending errors.
What an irreversible error describes is that it simply outputs a stream of errors and allows the script to continue execution. However, it cannot be caught using try / catch, since the exception is not actually "thrown".
As for the final error, it outputs the error to the error stream and, if not processed, completely stops the script on its tracks, preventing anything below the line in which the error occurred during execution. It can be caught by try / catch.
But it seems that there is a third type error that I cannot find information or a name for.
This is an error, which is a kind of mixture between a terminating and a non-reversing error ... When generating, it does not interrupt the script, providing it with error properties that are not related to completion, but it can be caught by try / catch, which gives it the properties of a final error!
And this is the easiest type of error. These are exceptions that are thrown directly by .NET itself, and not by PowerShell functions or cmdlets.
A few examples:
- Division by 0.
- Invoking an object method with invalid arguments β whether itβs the wrong parameter types (which PowerShell cannot automatically force), the wrong number of arguments, etc. - example:
'a'.Split([object[]])
, ? - ErrorRecord, Exception, , .