PowerShell Pester testing – Getting started

screenshot-4sysops.com 2016-03-06 12-47-54Pester is a testing framework that allows you to validate the functionality of your PowerShell scripts. In a series of several posts, I will give you an overview of how you can test your PowerShell scripts. In today’s post, I show you how to get started with Pester.

System administrators have traditionally been the ones to use the tools developers provide to them. Although most admins write scripts to automate various tasks, the code is not taken all that seriously. If it works, it works, and it’s time to move on. The problem stems from the mentality that PowerShell scripters have versus that of PowerShell developers. When PowerShell was first brought into the world, its core focus was for system administrators. System administrators loved writing scripts to automate various tasks, but PowerShell was never a development platform, per se.

Fast forward to 2016, where you now have classes, robust debugging support, and a community dedicated to taking PowerShell from being treated just as a scripting language to being acknowledged as a development language. I’m a perfect example of this. I’m a Senior Systems Automation Engineer, and I write PowerShell all day, every day. I check my code into source control, collaborate with others on my code, and am involved in the occasional releases of our automation platform to customers. I’m a PowerShell developer, and at this point, it’s time to get serious and to start investing in testing…

Read the full article at 4SysOps.

Adam Bertram

Chief Automator at Adam the Automator, LLC
Adam Bertram is an independent consultant, technical writer, trainer and presenter. Adam specializes in consulting and evangelizing all things IT automation mainly focused around Windows PowerShell. Adam is a Microsoft Windows PowerShell MVP, 2015 powershell.org PowerShell hero and has numerous Microsoft IT pro certifications. He authors IT pro course content for Pluralsight, is a regular contributor to numerous print and online publications and presents at various user groups and conferences.You can find Adam here on the blog or on Twitter at @adbertram.

Leave a Reply