Skip to content

Latest commit

 

History

History

Try-and-trap-catch-terminating-errors

try and trap catch terminating errors

try and trap catch only terminating and semi-terminating errors. Thus, if the current error action preference is not Stop then non-terminating errors are not caught. Note that the default PowerShell error action preference is Continue.

In order to catch all errors use

    $ErrorActionPreference = 'Stop'

Scripts