Pester
Pester is the name of an open source project that has become the de facto standard in testing PowerShell code, so much so that it is a Microsoft sponsored project that is being included in Windows 10. We can use Pester to write repeatable tests that run against our DSC resources as we develop them.
Pester and testing in general are expansive topics, so, if you need a starting point or a good refresher, the Pester WiKi page (https://github.com/pester/Pester/wiki) is the perfect place to start.
Here is an example Pester script that tests ExampleResource we have been using in our examples using the cmdlets from the xDscResourceDesigner module. This script will test our DSC resources and output any errors as we develop them:
powershell ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access