Пример #1
0
        void InitializeOldSkoolShell()
        {
            var thread = new System.Threading.Thread(() =>
            {
                var config = RunspaceConfiguration.Create();

                config.InitializationScripts.Append(new ScriptConfigurationEntry(
                                                        "warn-defaultconsole",
                                                        Scripts.WarnDefaultConsole
                                                        )
                                                    );

                config.InitializationScripts.Append(new ScriptConfigurationEntry(
                                                        "start-studioshell",
                                                        Scripts.StartStudioShell
                                                        )
                                                    );

                config.InitializationScripts.Append(new ScriptConfigurationEntry(
                                                        "start-profile",
                                                        Scripts.CreateRunProfileScript(new StudioShellProfileInfo())
                                                        )
                                                    );

                AllocConsole();
                Microsoft.PowerShell.ConsoleShell.Start(
                    config,
                    "Visual Studio Default Process Console",
                    "",
                    new string[] {});
            });

            thread.Start();
        }