Pester Test Inception and the Show Parameter

My fantastic friend Andre Kamman b | t  and I presented at PSConfEu last week and whilst we were there we were chatting about running Pester Tests. He wanted to know how he could run a Pester Test and not lose the failed tests as they scrolled past him. In his particular example we were […]

PowerShell Conference Europe – Green is bad Red is Good – Turning your Checklists into Pester Tests

Relevant to any technicians who use checklists. Intro level and idea forming, getting people to look at the way they can use Pester I was required to prove that I had successfully installed and configured a backup solution across a large estate. I had a number of success criteria that had to be met. Checking all of these by hand (eye) would have been error prone, so I wrote a test to do this for me and an easy for management to read HTML report using PowerShell and Pester. The session has come from that situation and is about enabling you to provide an easy to read output to quickly and repeatedly show that infrastructure is as expected for a set of checks. There are many use cases for this type of solution; DR testing, installation, first line checks, presentation setups After this session you will have a basic understanding of how Pester works and the capability to examine your checklists and create your own validation tests and provide some reporting for management. You will pick up ideas of processes and checks that can be automated within your company I am able to perform the following checks in 15 minutes across hundreds of servers and thousands of databases and I think it is cool and useful and everyone should be able to do so and take the functionality to create their own. Every Job in Ola Hallengrens Maintenance Solution exists, is enabled, has a schedule, has succeeded, has 2 job steps, has a generate restore script job step, the root backup folder is contactable, for every database the correct folders exist for the full, differential and log backup depending on recovery model in that folder, that each of those backup folders has files in it, that the most recent file in each of those folders is less than the required frequency for those job Event Page Code and Slides    Most inspiring session of the day! Thanks @sqldbawithbeard #psconfeu #pester pic.twitter.com/AzYuGlndX5 — Tom-Inge Larsen (@ti83) May 3, 2017 "According to my watch, I'm 26 minutes into a dynamic workout" – @sqldbawithbeard live on stage at #PSConfEU pic.twitter.com/kNoNI5Ts5C — Mathias Jessen (@IISResetMe) May 3, 2017 The @sqldbawithbeard in action #PSConfEU – have you done your tests today ?? — Flemming Rohde (@FlemmingRohde) May 3, 2017   Let's go with Pester #PSConfEU @PSConfEU @sqldbawithbeard #mythbusters pic.twitter.com/zRZgIDDGI6 — M.S. (@eich0rn) May 3, 2017 The magnificent @sqldbawithbeard competes against the “comprehensive slide” award. #PSConfEu pic.twitter.com/avVvsO8tPy — 🏳️‍🌈 Thorsten Butz (@thorstenbutz) May 3, 2017      

Using Pester with Get-DbaLastGoodCheckDb from dbatools

In my last post I showed Get-DbaLastGoodCheckDb  from dbatools. This module is a community based project written by excellent, brilliant people in their own time and available to you free. To find out more and how to use and install it visit https://dbatools.io In a similar fashion to my post about using Pester with Test-DBALastBackup I […]

Using Pester with dbatools Test-DbaLastBackup

In previous posts I have shown how to use Test-DbaLastBackup from dbatools and how you can make use of the results. Today we will look at using  Pester with the results Pester provides a framework for running unit tests to execute and validate PowerShell commands from within PowerShell. Pester consists of a simple set of functions […]

SQL North East User Group – Green is good, Red is bad – Turning your Checklists into Pester Tests

I was required to prove that I had successfully installed and configured a backup solution across a large estate. I had a number of success criteria that had to be met. Checking all of these by hand (eye) would have been error prone, so I wrote a test to do this for me and an easy for management to read HTML report using PowerShell and Pester. The session has come from that situation and is about enabling you to provide an easy to read output to quickly and repeatedly show that infrastructure is as expected for a set of checks, also known as Operational Validation using Pester. There are many use cases for this type of solution; DR testing, installation, first line checks, presentation setups What is Pester? Pester is a Unit Testing framework for PowerShell which can be used for testing your code but also as shown in this session for validating your infrastructure. This is an excellent post by Adam Bertram to introduce Pester It is included with PowerShell on modern Operating Systems and free to download from the PowerShell Gallery or GitHub if not included After this session you will have a basic understanding of how Pester works and the capability to examine your checklists and create your own validation tests and provide some reporting for management. PowerShell dbatools / SQL Server module Rob Sewell SQLServer and PowerShell an exploration. Event Page Code Slides So @sqlne had a double dose of @gfritchey tonight. Here they are watching the backup rant pic.twitter.com/sUhqbhb9Sd — Rob Sewell (@sqldbawithbeard) March 7, 2017 @SQLNE @sqldbawithbeard thanks for a great night of @sqlpowershell and intro to @psdbatools — Malcolm Smith (@mhSQL) March 7, 2017  

SQL Saturday Slovenia – Green is Good Red is Bad – Turning Your Checklists into Pester Tests

This session is for DBAs specifically, but will be relevant to any technicians who use checklists I was required to prove that I had successfully installed and configured a backup solution across a large estate. I had a number of success criteria that had to be met. Checking all of these by hand (eye) would have been error prone, so I wrote a test to do this for me and an easy for management to read HTML report using PowerShell and Pester. The session has come from that situation and is about enabling you to provide an easy to read output to quickly and repeatedly show that infrastructure is as expected for a set of checks, also known as Operational Validation using Pester. There are many use cases for this type of solution; DR testing, installation, first line checks, presentation setups After this session you will have a basic understanding of how Pester works and the capability to examine your checklists, create own validation tests and provide reports for managers. Event Page Code PPTX Pester tests and checklists with @sqldbawithbeard #sqlsatSlovenia pic.twitter.com/hw7kSffBIr — Gianluca Sartori (@spaghettidba) December 10, 2016 Pester is bloody amazing! #sqlsatSlovenia // @sqldbawithbeard — William Durkin (@sql_williamd) December 10, 2016 Great presentation and trully inspirational. Thanks @sqldbawithbeard for this #sqlsatSlovenia session — Marko Radakovic (@MarkoSQL) December 10, 2016  

Southampton SQL User Group – Turn Your Checklist into a Pester Test

This session is for DBAs specifically, but will be relevant to any technicians who use checklists I was required to prove that I had successfully installed and configured a backup solution across a large estate. I had a number of success criteria that had to be met. Checking all of these by hand (eye) would have been error prone, so I wrote a test to do this for me and an easy for management to read HTML report using PowerShell and Pester. The session has come from that situation and is about enabling you to provide an easy to read output to quickly and repeatedly show that infrastructure is as expected for a set of checks, also known as Operational Validation using Pester. There are many use cases for this type of solution; DR testing, installation, first line checks, presentation setups After this session you will have a basic understanding of how Pester works and the capability to examine your checklists, create own validation tests and provide reports for managers. Event Page Code PPTX Thank you for@sqldbawithbeard for Powershell presentation @SQLSoton last night 🙂 — Emad (@gobiman) December 8, 2016

PowerShell, Pester and Ola Hallengrens Maintenance Solution

If you are a SQL DBA you will have heard of Ola Hallengrens Maintenance solution If you haven’t go and click the link and look at the easiest way to ensure that all of your essential database maintenance is performed. You can also watch a video from Ola at SQL Bits Recently I was thinking […]

Some Pester Tests for SQL Defaults

When I was at PowerShell Conference EU in Hannover last month (The videos are available now – click here and the slides and code here) I found out about Irwin Strachans Active Directory Operations Test which got me thinking. I decided to do the same for my usual SQL Set-up. Treating all of your servers […]

PowerShell Pester Testing for Parameter Validation

This error caught me out. I am putting this post here firstly to remind me if I do it again adn also to help others who may hit the same issue. Today I am rewriting a function to create a Hyper-V VM so that I can properly script the creation of my labs for demos […]