Parameter Validation Using Pester

Rob Sewell is using Pester to write Powershell unit tests and wants to test the existence of a parameter:

Here is the start of the function. I validate the VMName parameter to ensure that there a VM with that  name does not already exist

Before Rob’s posts, I hadn’t seen Pester before, but if you write a lot of Powershell code, it looks like a nice testing framework.

Related Posts

tSQLt And VS Database Tests

Gavin Campbell combines tSQLt along with a Visual Studio database test project: There are a few ways of getting the tSQLt objects deployed to where they are needed for testing, the way I use most often is basically this one, whereby we create a .dacpac of just the tSQLt objects (or use one we made earlier!), and create […]

Read More

Testing Backups With dbatools

Constantine Kokkinos shows off a dbatools cmdlet to test the last full backup: This: Defines a list of two servers (PowerShell lists are as easy as “”,””) Pipes them to the Test-DbaLastBackup command. Which then: Gathers information about the last full backups for all of your databases on that instance. Restores the backups to the Destination with […]

Read More

Categories

February 2016
MTWTFSS
« Jan Mar »
1234567
891011121314
15161718192021
22232425262728
29