diff --git a/Functions/Context.ps1 b/Functions/Context.ps1 index bde731096..7970d2115 100644 --- a/Functions/Context.ps1 +++ b/Functions/Context.ps1 @@ -85,7 +85,7 @@ https://pester.dev/docs/usage/testdrive if ($null -eq (& $SafeCommands['Get-Variable'] -Name Pester -ValueOnly -ErrorAction $script:IgnoreErrorPreference)) { # User has executed a test script directly instead of calling Invoke-Pester $sessionState = Set-SessionStateHint -PassThru -Hint "Caller - Captured in Context" -SessionState $PSCmdlet.SessionState - $Pester = New-PesterState -Path (& $SafeCommands['Resolve-Path'] .) -TestNameFilter $null -TagFilter @() -SessionState SessionState + $Pester = New-PesterState -Path (& $SafeCommands['Resolve-Path'] .) -TestNameFilter $null -TagFilter @() -SessionState $sessionState $script:mockTable = @{ } }