Example #1
0
 public ExecutionContext(PSHost host, RunspaceConfiguration config)
     : this()
 {
     RunspaceConfiguration = config;
     LocalHost             = host;
     SessionStateGlobal    = new SessionStateGlobal(this);
     SessionState          = new SessionState(SessionStateGlobal);
 }
Example #2
0
 public ExecutionContext(PSHost host, RunspaceConfiguration config)
     : this()
 {
     RunspaceConfiguration = config;
     LocalHost = host;
     SessionStateGlobal = new SessionStateGlobal(this);
     SessionState = new SessionState(SessionStateGlobal);
 }
Example #3
0
 // internal
 internal SessionState(SessionStateGlobal sessionState)
 {
     SessionStateGlobal = sessionState;
     Drive = new DriveManagementIntrinsics(sessionState);
     Path = new PathIntrinsics(sessionState);
     Provider = new CmdletProviderManagementIntrinsics(sessionState);
     PSVariable = new PSVariableIntrinsics(sessionState);
 }
Example #4
0
        private ExecutionContext()
        {
            // TODO: create a "Global Session state"
            if (_sessionStateGlobal == null)
                _sessionStateGlobal = new SessionStateGlobal(this);

            // TODO: initialize all the default settings
            _pipelineStack = new Stack<Pipeline>();
            _variables = new Dictionary<string, PSVariable>(StringComparer.CurrentCultureIgnoreCase);
            SessionState = new SessionState(_sessionStateGlobal);
        }
Example #5
0
        private ExecutionContext()
        {
            // TODO: create a "Global Session state"
            if (_sessionStateGlobal == null)
            {
                _sessionStateGlobal = new SessionStateGlobal(this);
            }

            // TODO: initialize all the default settings
            _pipelineStack = new Stack <Pipeline>();
            _variables     = new Dictionary <string, PSVariable>(StringComparer.CurrentCultureIgnoreCase);
            SessionState   = new SessionState(_sessionStateGlobal);
        }
Example #6
0
        //actual constructor work, but hidden to not be used accidently in a stupid way
        private SessionState(SessionStateGlobal sessionStateGlobal, SessionStateScope<FunctionInfo> functions,
                             SessionStateScope<PSVariable> variables, SessionStateScope<PSDriveInfo> drives,
                             SessionStateScope<AliasInfo> aliases)
        {
            SessionStateGlobal = sessionStateGlobal;

            _aliasScope = new SessionStateScope<AliasInfo>(aliases, SessionStateCategory.Alias);
            _functionScope = new SessionStateScope<FunctionInfo>(functions, SessionStateCategory.Function);
            _variableScope = new SessionStateScope<PSVariable>(variables, SessionStateCategory.Variable);
            _driveScope = new SessionStateScope<PSDriveInfo>(drives, SessionStateCategory.Drive);

            IsScriptScope = false;
            Function = new FunctionIntrinsics(this, _functionScope);
            Alias = new AliasIntrinsics(this, _aliasScope);

            Drive = new DriveManagementIntrinsics(this, _driveScope);
            Path = new PathIntrinsics(SessionStateGlobal);
            Provider = new CmdletProviderManagementIntrinsics(SessionStateGlobal);
            PSVariable = new PSVariableIntrinsics(this, _variableScope);
        }
Example #7
0
 // creates a session state with a new (glovbal) scope
 internal SessionState(SessionStateGlobal sessionStateGlobal)
     : this(sessionStateGlobal, null, null, null, null)
 {
     defaultInit();
 }
 internal CmdletProviderManagementIntrinsics(SessionStateGlobal sessionState)
 {
     _sessionState = sessionState;
 }
 internal DriveManagementIntrinsics(SessionStateGlobal sessionState)
 {
     _sessionState = sessionState;
 }
Example #10
0
 internal PSVariableIntrinsics(SessionStateGlobal sessionState)
 {
     _sessionState = sessionState;
 }
Example #11
0
 internal PathIntrinsics(SessionStateGlobal sessionState)
 {
     _sessionState = sessionState;
 }
 internal CmdletProviderManagementIntrinsics(SessionStateGlobal sessionState)
 {
     _sessionState = sessionState;
     _providers = new Dictionary<string, List<ProviderInfo>>(StringComparer.CurrentCultureIgnoreCase);
     _providerInstances = new Dictionary<ProviderInfo, CmdletProvider>();
 }
Example #13
0
 internal PathIntrinsics(SessionState sessionState)
 {
     _sessionState = sessionState;
     _sessionStateGlobal = sessionState.SessionStateGlobal;
 }
Example #14
0
 // creates a session state with a new (glovbal) scope
 internal SessionState(SessionStateGlobal sessionStateGlobal)
     : this(sessionStateGlobal, null, null, null, null)
 {
 }