Skip to content

Files

Latest commit

ff719dc · Jun 17, 2022

History

History
25 lines (18 loc) · 985 Bytes

File metadata and controls

25 lines (18 loc) · 985 Bytes

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