fix: harden powershell wrapper detection

This commit is contained in:
Peter Steinberger
2026-03-13 20:37:29 +00:00
parent e2fa47f5f2
commit 28a49aaa34
4 changed files with 20 additions and 0 deletions

View File

@@ -22,6 +22,21 @@ describe("resolveInlineCommandMatch", () => {
command: "Get-ChildItem",
valueTokenIndex: 2,
});
expect(
resolveInlineCommandMatch(["pwsh", "-File", "script.ps1"], POWERSHELL_INLINE_COMMAND_FLAGS),
).toEqual({
command: "script.ps1",
valueTokenIndex: 2,
});
expect(
resolveInlineCommandMatch(
["powershell", "-f", "script.ps1"],
POWERSHELL_INLINE_COMMAND_FLAGS,
),
).toEqual({
command: "script.ps1",
valueTokenIndex: 2,
});
});
it("supports combined -c forms only when enabled", () => {