diff --git a/dist/index.js b/dist/index.js index 74f102d..fad4fbd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -335,7 +335,8 @@ class DotnetCoreInstaller { } scriptArguments.push(`-InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'`); // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - scriptPath = yield io.which('powershell', true); + scriptPath = + (yield io.which('pwsh', false)) || (yield io.which('powershell', true)); scriptArguments = [...windowsDefaultOptions, scriptArguments.join(' ')]; } else { diff --git a/src/installer.ts b/src/installer.ts index 7850510..646b1ca 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -209,7 +209,8 @@ export class DotnetCoreInstaller { `-InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'` ); // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - scriptPath = await io.which('powershell', true); + scriptPath = + (await io.which('pwsh', false)) || (await io.which('powershell', true)); scriptArguments = [...windowsDefaultOptions, scriptArguments.join(' ')]; } else { chmodSync(escapedScript, '777');