update to use pwsh if it is available

This commit is contained in:
Thomas Boop 2022-09-16 10:11:37 -04:00
parent fd4e15fa44
commit 6bd8f44edc
2 changed files with 9 additions and 2 deletions

5
dist/index.js vendored
View File

@ -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) => {

View File

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