From 6bd8f44edcc4986547d0c986a96f38000b031cf7 Mon Sep 17 00:00:00 2001 From: Thomas Boop Date: Fri, 16 Sep 2022 10:11:37 -0400 Subject: [PATCH] update to use pwsh if it is available --- dist/index.js | 5 ++++- src/installer.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index d897c56..7b8699d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -275,7 +275,10 @@ class DotnetCoreInstaller { command += ` -ProxyBypassList ${process.env['no_proxy']}`; } // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - const powershellPath = yield io.which('powershell', true); + let powershellPath = yield io.which('pwsh', false); + if (powershellPath == '') { + powershellPath = yield io.which('powershell', true); + } var options = { listeners: { stdout: (data) => { diff --git a/src/installer.ts b/src/installer.ts index c25d23a..368c4c9 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -116,7 +116,11 @@ export class DotnetCoreInstaller { } // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - const powershellPath = await io.which('powershell', true); + let powershellPath = await io.which('pwsh', false); + if (powershellPath == '') + { + powershellPath = await io.which('powershell', true); + } var options: ExecOptions = { listeners: {