The Pester Book Chapter Review (18)

Table of ContentsTroubleshooting Tests

Welcome to the last chapter review of Part II of The Pester Book. We’ve come along way since the beginning. Even the book would agree. According to this chapter, our “training wheels are off…” This is to say that we know some things about Pester now, and really, after all this reading and the overall learning, it’s no surprise. Let’s, “…get down to it.” The purpose behind this chapter isn’t to teach, as much as it’s to determine what we might be able to do as we have problems with Pester.

At first we touched on the option to add a variable inside your script to determine its value during run time. While there’s probably better ways to handle this, we checked our variable’s value from inside the test instead of inside the function. Good to know that the ParameterFilter parameter is just a ScriptBlock, and so we can view the value there. The book agreed there are better ways in which to troubleshoot our tests.

We then moved into breakpoints. This is the more official, and grownup, way to track the values of variables. That said, the example in the book opted to set a breakpoint on a command. That meant that when the command was invoked, the code process stopped in order that we were able to determine the value of a variable right then.

Great stuff, but now, it’s time for Part III. That’s right, Part I and II are officially read and reviewed.

Leave a Reply

Your email address will not be published. Required fields are marked *