diff --git a/packages/tool-cache/__tests__/tool-cache.test.ts b/packages/tool-cache/__tests__/tool-cache.test.ts index 3722d18b91..d03c9b392c 100644 --- a/packages/tool-cache/__tests__/tool-cache.test.ts +++ b/packages/tool-cache/__tests__/tool-cache.test.ts @@ -553,7 +553,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta', @@ -604,7 +606,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta', @@ -661,7 +665,9 @@ describe('@actions/tool-cache', function() { if (IS_WINDOWS) { const escapedStagingPath = stagingDir.replace(/'/g, "''") // double-up single quotes const escapedZipFile = zipFile.replace(/'/g, "''") - const powershellPath = await io.which('powershell', true) + const powershellPath = + (await io.which('pwsh', false)) || + (await io.which('powershell', true)) const args = [ '-NoLogo', '-Sta',