Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RunspaceFixture"/> class.
        /// </summary>
        public RunspaceFixture()
        {
            host = new TestableHost();

            var state = InitialSessionState.CreateDefault2();

            state.AuthorizationManager = null;
            state.LanguageMode         = PSLanguageMode.RestrictedLanguage;
            state.ImportPSModule(new[] { @".\RestartManager.psd1" });

            runspace = RunspaceFactory.CreateRunspace(host, state);
            runspace.Open();
        }
Example #2
0
 public ServiceScope(TestableHost host, RestartManager.IServiceProvider services)
 {
     this.host     = host;
     host.Services = services;
 }