diff --git a/package.json b/package.json index 4f9cc4c8a0..565c5abbff 100644 --- a/package.json +++ b/package.json @@ -467,6 +467,11 @@ "description": "Optional: The ID of the runspace to debug in the attached process. Defaults to 1. Works only on PowerShell 5 and above.", "default": null }, + "runspaceName": { + "type": "string", + "description": "Optional: The Name of the runspace to debug in the attached process. Works only on PowerShell 5 and above.", + "default": null + }, "customPipeName": { "type": "string", "description": "The custom pipe name of the PowerShell host process to attach to. Works only on PowerShell 6.2 and above.", diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 8943ced400..64826ca90e 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -87,7 +87,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider } } - if (!config.runspaceId) { + if (!config.runspaceId && !config.runspaceName) { config.runspaceId = await vscode.commands.executeCommand("PowerShell.PickRunspace", config.processId); // No runspace selected. Cancel attach.