Skip to content

Commit 35bfefe

Browse files
wait for completion of script
1 parent b9f9fab commit 35bfefe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PowerShellEditorServices/Server/PsesDebugServer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public async Task StartAsync(IServiceProvider languageServerServiceProvider, boo
5454
_powerShellContextService.IsDebugServerActive = true;
5555

5656
// Needed to make sure PSReadLine's static properties are initialized in the pipeline thread.
57-
_powerShellContextService.ExecuteScriptStringAsync("[System.Runtime.CompilerServices.RuntimeHelpers]::RunClassConstructor([Microsoft.PowerShell.PSConsoleReadLine].TypeHandle)");
57+
_powerShellContextService
58+
.ExecuteScriptStringAsync("[System.Runtime.CompilerServices.RuntimeHelpers]::RunClassConstructor([Microsoft.PowerShell.PSConsoleReadLine].TypeHandle)")
59+
.Wait();
5860

5961
options.Services = new ServiceCollection()
6062
.AddPsesDebugServices(languageServerServiceProvider, this, useExistingSession);

0 commit comments

Comments
 (0)