Clone() public method

public Clone ( ScopeUsages scopeUsage = ScopeUsages.CurrentScope ) : ExecutionContext
scopeUsage ScopeUsages
return ExecutionContext
Exemplo n.º 1
0
        internal override void ProcessRecord()
        {
            ExecutionContext context = ExecutionContext.Clone();

            PipelineCommandRuntime pipelineCommandRuntime = (PipelineCommandRuntime)CommandRuntime;

            this._scriptInfo.ScriptBlock.Ast.Visit(new ExecutionVisitor(context, pipelineCommandRuntime, false));
        }
Exemplo n.º 2
0
        private void CreateOwnScope()
        {
            _originalContext = ExecutionContext;
            var executionSessionState = CommandInfo.Module != null ? CommandInfo.Module.SessionState
                                                                   : ExecutionContext.SessionState;

            _scopedContext          = ExecutionContext.Clone(executionSessionState, _scriptBlockInfo.ScopeUsage);
            _scopedExecutionVisitor = new ExecutionVisitor(_scopedContext, CommandRuntime, false);
        }
Exemplo n.º 3
0
 private void CreateOwnScope()
 {
     _originalContext = ExecutionContext;
     _scopedContext   = ExecutionContext.Clone(_scriptBlockInfo.ScopeUsage);
 }
Exemplo n.º 4
0
 private void CreateOwnScope()
 {
     _originalContext        = ExecutionContext;
     _scopedContext          = ExecutionContext.Clone(_scriptBlockInfo.ScopeUsage);
     _scopedExecutionVisitor = new ExecutionVisitor(_scopedContext, CommandRuntime, false);
 }