O'Reilly logo

Learn PowerShell Toolmaking in a Month of Lunches by Don Jones and Jeffrey Hicks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.3. The real trick to debugging: expectations

As we mentioned earlier, assumptions and expectations are at the heart of the trickier errors and bugs that you’ll find. Before you can begin debugging, you therefore have to have an expectation for what each line of your script will do, and you have to be able to validate those expectations. When you find the place where your expectation differs from reality, then you’ve found your bug. But you can’t debug without first sitting down and thinking about what the script is supposed to do—or at least what you think it’s supposed to do.

This is exactly where most folks go wrong. The idea of sitting down and poring over a script, line by line, seems inefficient, boring, and frustrating. So they’ll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required