File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,10 @@ function Should-InvokeInternal {
411411 $nonMatchingCalls = [System.Collections.Generic.List [object ]]@ ()
412412
413413 # Check for variables in ParameterFilter that already exists in session. Risk of conflict
414- if ($PesterPreference.Debug.WriteDebugMessages.Value ) {
414+ # Excluding native applications as they don't have parameters or metadata. Will always use $args
415+ if ($PesterPreference.Debug.WriteDebugMessages.Value -and
416+ $null -ne $ContextInfo.Hook.Metadata -and
417+ $ContextInfo.Hook.Metadata.Parameters.Count -gt 0 ) {
415418 $preExistingFilterVariables = @ {}
416419 foreach ($v in $filter.Ast.FindAll ( { $args [0 ] -is [System.Management.Automation.Language.VariableExpressionAst ] }, $true )) {
417420 if (-not $preExistingFilterVariables.ContainsKey ($v.VariablePath.UserPath )) {
You can’t perform that action at this time.
0 commit comments