internal static CommandProcessorBase CreateCommandProcessorForScript( FunctionInfo functionInfo, ExecutionContext context, bool useNewScope) { return(CommandDiscovery.GetScriptAsCmdletProcessor((IScriptCommandInfo)functionInfo, context, useNewScope, false) ?? (CommandProcessorBase) new ScriptCommandProcessor(functionInfo, context, useNewScope)); }
internal static CommandProcessorBase CreateCommandProcessorForScript( ScriptBlock scriptblock, ExecutionContext context, bool useNewScope) { return(scriptblock.UsesCmdletBinding ? CommandDiscovery.GetScriptAsCmdletProcessor((IScriptCommandInfo) new FunctionInfo("", scriptblock, context), context, useNewScope, false) : (CommandProcessorBase) new ScriptCommandProcessor(scriptblock, context, useNewScope)); }
private static CommandProcessorBase CreateCommandProcessorForScript( ExternalScriptInfo scriptInfo, ExecutionContext context, bool useNewScope) { return(CommandDiscovery.GetScriptAsCmdletProcessor((IScriptCommandInfo)scriptInfo, context, useNewScope, true) ?? (CommandProcessorBase) new ScriptCommandProcessor(scriptInfo, context, useNewScope)); }