File tree 1 file changed +3
-9
lines changed
src/PowerShellEditorServices/Services/PowerShell/Host
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -615,7 +615,7 @@ public PowerShell CreateInitialPowerShell(
615
615
HostStartupInfo hostStartupInfo ,
616
616
ReadLineProvider readLineProvider )
617
617
{
618
- Runspace runspace = CreateInitialRunspace ( hostStartupInfo . LanguageMode ) ;
618
+ Runspace runspace = CreateInitialRunspace ( hostStartupInfo . InitialSessionState ) ;
619
619
PowerShell pwsh = CreatePowerShellForRunspace ( runspace ) ;
620
620
621
621
var engineIntrinsics = ( EngineIntrinsics ) runspace . SessionStateProxy . GetVariable ( "ExecutionContext" ) ;
@@ -650,15 +650,9 @@ public PowerShell CreateInitialPowerShell(
650
650
return pwsh ;
651
651
}
652
652
653
- private Runspace CreateInitialRunspace ( PSLanguageMode languageMode )
653
+ private Runspace CreateInitialRunspace ( InitialSessionState initialSessionState )
654
654
{
655
- InitialSessionState iss = Environment . GetEnvironmentVariable ( "PSES_TEST_USE_CREATE_DEFAULT" ) == "1"
656
- ? InitialSessionState . CreateDefault ( )
657
- : InitialSessionState . CreateDefault2 ( ) ;
658
-
659
- iss . LanguageMode = languageMode ;
660
-
661
- Runspace runspace = RunspaceFactory . CreateRunspace ( PublicHost , iss ) ;
655
+ Runspace runspace = RunspaceFactory . CreateRunspace ( PublicHost , initialSessionState ) ;
662
656
663
657
runspace . SetApartmentStateToSta ( ) ;
664
658
runspace . ThreadOptions = PSThreadOptions . UseCurrentThread ;
You can’t perform that action at this time.
0 commit comments