Trap

PowerShell 1.0 came with trap. trap is used to catch errors raised anywhere within the scope of the trap declaration. That is, the current scope, and any child scopes.

trap is a useful tool for capturing errors that are not accounted for by try-catch blocks. Much of its use has been superseeded by try-catch-finally.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset