O'Reilly logo

Learn PowerShell Scripting in a Month of Lunches by Don Jones and Jeffery 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

Chapter 9. Avoiding bugs: start with a command

Before we ever fire up a script editor, we start in the basic PowerShell command-line window. This is your lowest common denominator for testing, and it’s a perfect way to make sure the commands your tool will run are correct. It’s way easier to debug or troubleshoot a single command from an interactive console than it is to debug an entire script. And by “a single command,” we mean a PowerShell expression—a single thing that we can manually type into the console to see if we’ve got the right syntax.

This is by design

One of the cool parts about PowerShell is that you can open a console, run commands, and get immediate results (or errors). Traditionally, programmers have had to write ...

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