Ejemplo n.º 1
0
 internal static CommandProcessorBase CreateCommandProcessorForScript(
     FunctionInfo functionInfo,
     ExecutionContext context,
     bool useNewScope)
 {
     return(CommandDiscovery.GetScriptAsCmdletProcessor((IScriptCommandInfo)functionInfo, context, useNewScope, false) ?? (CommandProcessorBase) new ScriptCommandProcessor(functionInfo, context, useNewScope));
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 private static CommandProcessorBase CreateCommandProcessorForScript(
     ExternalScriptInfo scriptInfo,
     ExecutionContext context,
     bool useNewScope)
 {
     return(CommandDiscovery.GetScriptAsCmdletProcessor((IScriptCommandInfo)scriptInfo, context, useNewScope, true) ?? (CommandProcessorBase) new ScriptCommandProcessor(scriptInfo, context, useNewScope));
 }