/// <summary> /// Initialize the PowerShell host. /// </summary> private void InitializePowerShellHost() { var page = (GeneralDialogPage)GetDialogPage(typeof(GeneralDialogPage)); ResetPowerShellSession = page.ResetPowerShellSession; OverrideExecutionPolicyConfiguration = page.OverrideExecutionPolicyConfiguration; Log.Info("InitializePowerShellHost"); _debugger = new ScriptDebugger(page.OverrideExecutionPolicyConfiguration); // Warm up the intellisense service due to the reason that the // first intellisense request is often times slower than usual // TODO: Should we move this into the HostService's initializiation? IntelliSenseService.GetDummyCompletionList(); DebuggerReadyEvent.Set(); PowerShellHostInitialized = true; if (page.ShouldLoadProfiles) { DebuggingService.LoadProfiles(); } SetReplLocationToSolutionDir(); _solutionEventsListener = new SolutionEventsListener(this); _solutionEventsListener.StartListeningForChanges(); _solutionEventsListener.SolutionOpened += _solutionEventsListener_SolutionOpened; }