fix(core): prefer pwsh.exe over Windows PowerShell 5.1 (#25859) (#25900)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
kaluchi
2026-05-18 20:44:05 +03:00
committed by GitHub
parent 7ff60809ef
commit dc47aaa2d9
10 changed files with 203 additions and 94 deletions
+3 -3
View File
@@ -365,7 +365,7 @@ describe('HookRunner', () => {
);
expect(spawn).toHaveBeenCalledWith(
expect.stringMatching(/bash|powershell/),
expect.stringMatching(/bash|pwsh|powershell/),
expect.arrayContaining([
expect.stringMatching(/['"]?\/test\/project['"]?\/hooks\/test\.sh/),
]),
@@ -408,7 +408,7 @@ describe('HookRunner', () => {
);
expect(spawn).toHaveBeenCalledWith(
expect.stringMatching(/bash|powershell/),
expect.stringMatching(/bash|pwsh|powershell/),
expect.arrayContaining([
expect.stringMatching(
/ls ['"]\/test\/project\/plans with spaces['"]/,
@@ -447,7 +447,7 @@ describe('HookRunner', () => {
// If secure, spawn will be called with the shell executable and escaped command
expect(spawn).toHaveBeenCalledWith(
expect.stringMatching(/bash|powershell/),
expect.stringMatching(/bash|pwsh|powershell/),
expect.arrayContaining([
expect.stringMatching(/ls (['"]).*echo.*pwned.*\1/),
]),