diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 84b8aaee1..74a281c06 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -207,6 +207,21 @@ function Get-PSOutput { } +function Start-PSPester { + [CmdletBinding()]param( + [string]$Flags = '-EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml', + [string]$Tests = "*", + [ValidateScript({ Test-Path -PathType Container $_})] + [string]$Directory = "$PSScriptRoot/test/powershell" + ) + + & (Get-PSOutput) -c "Invoke-Pester $Flags $Directory/$Tests" + if ($LASTEXITCODE -ne 0) { + throw "$LASTEXITCODE Pester tests failed" + } +} + + function Start-PSxUnit { [CmdletBinding()]param() if ($IsWindows) {