diff --git a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs index a5b0b3683..1d9813a48 100644 --- a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs +++ b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs @@ -702,7 +702,10 @@ private void RunExecutionLoop(bool isForDebug = false) PopPowerShell(RunspaceChangeAction.Exit); } - return; + if (ShouldExitExecutionLoop) + { + return; + } } }