diff --git a/src/functions/Mock.ps1 b/src/functions/Mock.ps1 index 486de0a50..fde382c4e 100644 --- a/src/functions/Mock.ps1 +++ b/src/functions/Mock.ps1 @@ -1529,7 +1529,7 @@ function Get-DynamicParametersForCmdlet { $Parameters = @{ } } - $cmdlet = & $SafeCommands['New-Object'] $command.ImplementingType.FullName + $cmdlet = ($command.ImplementingType)::new() $flags = [System.Reflection.BindingFlags]'Instance, Nonpublic' $context = $ExecutionContext.GetType().GetField('_context', $flags).GetValue($ExecutionContext)