Our module template also includes basic Pester tests. Pester is a unit testing framework that existed prior to the release of Windows PowerShell 5 and has since been integrated, albeit in an outdated version. Between the shipped version 3 and release 4, there are differences in the syntax, among other changes. See the following code sample regarding upgrading Pester to the most recent version:
# Update Pester to the current version to make use of the improvements Get-Module -List Pester # Built-in: 3.4.0 # Update PowerShellGet first if (-not (Get-Command Install-Module).Parameters.ContainsKey('SkipPublisherCheck')) { Update-Module -Name PowerShellGet -Force } # After updating PowerShellGet, make sure to close PowerShell and start a new process # We are using the new parameter SkipPublisherCheck since newer versions of Pester are not signed Install-Module -Name Pester -Force -SkipPublisherCheck # Verify Get-Module -List Pester
Pester introduces another domain-specific language...