Example #1
0
        private SessionStateGlobal()
        {
            _providers             = new Dictionary <string, List <ProviderInfo> >(StringComparer.CurrentCultureIgnoreCase);
            _providerInstances     = new Dictionary <string, List <CmdletProvider> >(StringComparer.CurrentCultureIgnoreCase);
            _providersCurrentDrive = new Dictionary <ProviderInfo, PSDriveInfo>();
            _drives = new PSDriveInfoCollection();
            _workingLocationStack = new Dictionary <string, Stack <PathInfo> >(StringComparer.CurrentCultureIgnoreCase);
            _aliases   = new Dictionary <string, AliasInfo>(StringComparer.CurrentCultureIgnoreCase);
            _functions = new Dictionary <string, CommandInfo>(StringComparer.CurrentCultureIgnoreCase);
            _variables = new HybridDictionary(true);

            SetVariable("true", true);
            SetVariable("false", false);
            SetVariable("null", null);
        }
Example #2
0
 internal SessionStateGlobal(ExecutionContext context)
     : this()
 {
     _executionContext = context;
     if (context.SessionState == null)
     {
         return;
     }
     if (context.SessionState.SessionStateGlobal == null)
     {
         return;
     }
     _providers             = context.SessionState.SessionStateGlobal._providers;
     _providersCurrentDrive = context.SessionState.SessionStateGlobal._providersCurrentDrive;
     _workingLocationStack  = context.SessionState.SessionStateGlobal._workingLocationStack;
     _drives    = context.SessionState.SessionStateGlobal._drives;
     _aliases   = context.SessionState.SessionStateGlobal._aliases;
     _functions = context.SessionState.SessionStateGlobal._functions;
     _variables = context.SessionState.SessionStateGlobal._variables;
 }
Example #3
0
 internal SessionStateGlobal(ExecutionContext context)
     : this()
 {
     _executionContext = context;
     if (context.SessionState == null)
         return;
     if (context.SessionState.SessionStateGlobal == null)
         return;
     _providers = context.SessionState.SessionStateGlobal._providers;
     _providersCurrentDrive = context.SessionState.SessionStateGlobal._providersCurrentDrive;
     _workingLocationStack = context.SessionState.SessionStateGlobal._workingLocationStack;
     _drives = context.SessionState.SessionStateGlobal._drives;
     _aliases = context.SessionState.SessionStateGlobal._aliases;
     _functions = context.SessionState.SessionStateGlobal._functions;
     _variables = context.SessionState.SessionStateGlobal._variables;
 }
Example #4
0
        private SessionStateGlobal()
        {
            _providers = new Dictionary<string, List<ProviderInfo>>(StringComparer.CurrentCultureIgnoreCase);
            _providerInstances = new Dictionary<string, List<CmdletProvider>>(StringComparer.CurrentCultureIgnoreCase);
            _providersCurrentDrive = new Dictionary<ProviderInfo, PSDriveInfo>();
            _drives = new PSDriveInfoCollection();
            _workingLocationStack = new Dictionary<string, Stack<PathInfo>>(StringComparer.CurrentCultureIgnoreCase);
            _aliases = new Dictionary<string, AliasInfo>(StringComparer.CurrentCultureIgnoreCase);
            _functions = new Dictionary<string, CommandInfo>(StringComparer.CurrentCultureIgnoreCase);
            _variables = new HybridDictionary(true);

            SetVariable("true", true);
            SetVariable("false", false);
            SetVariable("null", null);
        }