O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

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

9.2. Debugging Your Code

Debugging is the black art of finding and eliminating errors in computer programs. Logic errors have long been referred to as bugs, and popular legend has it that the first bug was a real moth stuck between the contacts of a relay in the U.S. Navy's Harvard Mark II computer. The fix back then was simple; the bug was extracted using tweezers.

Most programming languages and environments ship with a fully featured debugger system, a means to execute a program step-by-step and to inspect the intermediate results of its execution. For better or for worse, PowerShell does not contain a script debugger, and we have to resort to other techniques to eliminate errors in our programs. Luckily, using some ingenious tricks, we can ...

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