Skip to content

Commit 3ba830d

Browse files
committed
Make WinPS debug pick option platform-dependent
1 parent 23ba657 commit 3ba830d

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@
519519
}
520520
},
521521
{
522-
"label": "Run Pester Tests (Binary Module)",
522+
"label": "PowerShell: Run Pester Tests (Binary Module)",
523523
"description": "Debug a .NET binary or hybrid module by running Pester tests. Breakpoints you set in your .NET (C#/F#/VB/etc.) code will be hit upon command execution. You may want to add a compile or watch action as a pre-launch task to this configuration.",
524524
"body": {
525525
"name": "PowerShell: Binary Module Pester Tests",

src/features/DebugSession.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {
2424
type DebugSession,
2525
type ExtensionContext,
2626
type InputBoxOptions,
27-
type LogOutputChannel,
28-
type QuickPickItem,
29-
type QuickPickOptions,
30-
type WorkspaceFolder,
27+
type.LogOutputChannel,
28+
type.QuickPickItem,
29+
type.QuickPickOptions,
30+
type.WorkspaceFolder,
3131
} from "vscode";
3232
import { NotificationType, RequestType } from "vscode-languageclient";
3333
import { LanguageClient } from "vscode-languageclient/node";
@@ -278,13 +278,23 @@ export class DebugSessionFeature
278278
"Debug a .NET binary or hybrid module loaded into a PowerShell session. Breakpoints you set in your .NET (C#/F#/VB/etc.) code will be hit upon command execution. You may want to add a compile or watch action as a pre-launch task to this configuration.",
279279
},
280280
{
281-
id: DebugConfig.RunPester,
281+
id: DebugConfig.BinaryModulePester,
282282
label: "Run Pester Tests (Binary Module)",
283283
description:
284284
"Debug a .NET binary or hybrid module by running Pester tests. Breakpoints you set in your .NET (C#/F#/VB/etc.) code will be hit upon command execution. You may want to add a compile or watch action as a pre-launch task to this configuration.",
285-
},
285+
}
286286
];
287287

288+
// Only show the Windows PowerShell option if the platform is Windows
289+
const platformDetails = getPlatformDetails();
290+
if (platformDetails.operatingSystem === OperatingSystem.Windows) {
291+
debugConfigPickItems.push({
292+
id: DebugConfig.WindowsPowerShell,
293+
label: "Windows PowerShell",
294+
description: "Launch Windows PowerShell in a temporary integrated console for debugging",
295+
});
296+
}
297+
288298
const launchSelection = await window.showQuickPick(
289299
debugConfigPickItems,
290300
{ placeHolder: "Select a PowerShell debug configuration" },

0 commit comments

Comments
 (0)