Exemplo n.º 1
0
        public static PowerShellContextService Create(ILogger logger)
        {
            PowerShellContextService powerShellContext = new PowerShellContextService(logger, null, isPSReadLineEnabled: false);

            HostStartupInfo testHostDetails = new HostStartupInfo(
                "PowerShell Editor Services Test Host",
                "Test.PowerShellEditorServices",
                new Version("1.0.0"),
                null,
                TestProfilePaths,
                new List <string>(),
                new List <string>(),
                PSLanguageMode.FullLanguage,
                null,
                0,
                consoleReplEnabled: false,
                usesLegacyReadLine: false);


            powerShellContext.Initialize(
                TestProfilePaths,
                PowerShellContextService.CreateRunspace(
                    testHostDetails,
                    powerShellContext,
                    new TestPSHostUserInterface(powerShellContext, logger),
                    logger),
                true);

            return(powerShellContext);
        }