File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/PowerShellEditorServices/Services/PowerShell/Host Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -615,7 +615,7 @@ public PowerShell CreateInitialPowerShell(
615615 HostStartupInfo hostStartupInfo ,
616616 ReadLineProvider readLineProvider )
617617 {
618- Runspace runspace = CreateInitialRunspace ( hostStartupInfo . LanguageMode ) ;
618+ Runspace runspace = CreateInitialRunspace ( hostStartupInfo . InitialSessionState ) ;
619619 PowerShell pwsh = CreatePowerShellForRunspace ( runspace ) ;
620620
621621 var engineIntrinsics = ( EngineIntrinsics ) runspace . SessionStateProxy . GetVariable ( "ExecutionContext" ) ;
@@ -650,15 +650,9 @@ public PowerShell CreateInitialPowerShell(
650650 return pwsh ;
651651 }
652652
653- private Runspace CreateInitialRunspace ( PSLanguageMode languageMode )
653+ private Runspace CreateInitialRunspace ( InitialSessionState initialSessionState )
654654 {
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 ) ;
662656
663657 runspace . SetApartmentStateToSta ( ) ;
664658 runspace . ThreadOptions = PSThreadOptions . UseCurrentThread ;
You can’t perform that action at this time.
0 commit comments