Chapter 11: Debugging and Error Handling


Overview

It's difficult to write a script perfectly the first time, which is why debugging is such an important skill. Even when your script is spot-on, things can still go wrong, which is where error handling comes in handy.

Debugging is the process of fixing a script that isn't working correctly. It's probably one of the most time-consuming and frustrating parts about writing scripts in any language, including PowerShell. However, with the right approach debugging can be straightforward and, dare we say, even fun - like solving a puzzle. Error handling is sort of proactive debugging: Using special techniques, you build scripts that anticipate certain errors and deal with them on the fly, instead of just crashing.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net