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: {