Chapter 20. Pestering your script

As we move into a DevOps-y world, one of the things you’ll need to start thinking about is how you’ll test your scripts. Here’s the deal: Nobody likes a broken script in production. And although you might run a few tests on your script, you—or someone else—might also modify your script at some point, necessitating a retest. Or, you might find some odd condition under which your script fails—well, you certainly don’t want to forget to test that condition again in the future, do you? In this chapter, we’ll talk about automated unit testing for PowerShell scripts.

20.1. The vision

Here’s where we want to get you:

  1. You write some code, or modify some old code.
  2. You check your code into a source control repository. ...

Get Learn PowerShell Scripting in a Month of Lunches now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.