Summary
Error handling in PowerShell is a complex topic, perhaps made more so by inconsistencies in the documentation that can trip up new and experienced PowerShell users.
PowerShell includes the concept of non-terminating errors. Non-terminating errors allow a script, such as one acting on a pipeline, to carry on in the event of an error.
It is not always true that a problem that prevents an action from continuing will be described as a terminating error. The reverse is also true: not all actions that allow an action to continue are described as non-terminating errors. Therefore, care must be taken when writing code to correctly handle error conditions.
Non-terminating errors should be used when writing commands that expect to act on more than one object, if an error is restricted to that one object and does not prevent a broader activity from completing.
Terminating errors can be used when execution absolutely cannot continue.
PowerShell includes several different...