diff --git a/Functions/Gherkin.ps1 b/Functions/Gherkin.ps1 index 982dc3a4d..31e0f9e37 100644 --- a/Functions/Gherkin.ps1 +++ b/Functions/Gherkin.ps1 @@ -260,7 +260,7 @@ function Invoke-Gherkin { } } - $pester = New-PesterState -TagFilter @($Tag -split "\s+") -ExcludeTagFilter ($ExcludeTag -split "\s") -TestNameFilter $ScenarioName -SessionState $PSCmdlet.SessionState -Strict $Strict -Show $Show -PesterOption $PesterOption | + $pester = New-PesterState -TagFilter $Tag -ExcludeTagFilter $ExcludeTag -TestNameFilter $ScenarioName -SessionState $PSCmdlet.SessionState -Strict $Strict -Show $Show -PesterOption $PesterOption | & $SafeCommands["Add-Member"] -MemberType NoteProperty -Name Features -Value (& $SafeCommands["New-Object"] System.Collections.Generic.List[PSObject] ) -PassThru | & $SafeCommands["Add-Member"] -MemberType ScriptProperty -Name FailedScenarios -PassThru -Value { $Names = $this.TestResult | & $SafeCommands["Group-Object"] Describe | diff --git a/Pester.psm1 b/Pester.psm1 index 2fa7098f4..8e094b9ae 100644 --- a/Pester.psm1 +++ b/Pester.psm1 @@ -820,7 +820,7 @@ New-PesterOption $script:mockTable = @{} Remove-MockFunctionsAndAliases - $pester = New-PesterState -TestNameFilter $TestName -TagFilter ($Tag -split "\s") -ExcludeTagFilter ($ExcludeTag -split "\s") -SessionState $PSCmdlet.SessionState -Strict:$Strict -Show:$Show -PesterOption $PesterOption -RunningViaInvokePester + $pester = New-PesterState -TestNameFilter $TestName -TagFilter $Tag -ExcludeTagFilter $ExcludeTag -SessionState $PSCmdlet.SessionState -Strict:$Strict -Show:$Show -PesterOption $PesterOption -RunningViaInvokePester try {