We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2727c9c + 97369cc commit 1d07064Copy full SHA for 1d07064
src/shared/Core/WslUtils.cs
@@ -195,8 +195,16 @@ public static int GetWindowsSessionId(IFileSystem fs)
195
const string script = @"(Get-Process -ID $PID).SessionId";
196
using (Process proc = CreateWindowsShellProcess(fs, WindowsShell.PowerShell, script))
197
{
198
- proc.Start();
199
- proc.WaitForExit();
+ try
+ {
200
+ proc.Start();
201
+ proc.WaitForExit();
202
+ }
203
+ catch
204
205
+ // Unable to start the process, return unknown session ID
206
+ return -1;
207
208
209
if (proc.ExitCode == 0)
210
0 commit comments