diff --git a/.vsts-ci/install-ps.yml b/.vsts-ci/install-ps.yml index 97502e4f69..b752c5c8c9 100644 --- a/.vsts-ci/install-ps.yml +++ b/.vsts-ci/install-ps.yml @@ -14,6 +14,7 @@ trigger: - /tools/installpsh-osx.sh - /tools/installpsh-redhat.sh - /tools/installpsh-suse.sh + - /tools/install-powershell.ps1 pr: branches: include: @@ -27,6 +28,7 @@ pr: - /tools/installpsh-osx.sh - /tools/installpsh-redhat.sh - /tools/installpsh-suse.sh + - /tools/install-powershell.ps1 variables: DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -47,3 +49,9 @@ phases: scriptName: ./tools/install-powershell.sh jobName: InstallPowerShellMacOS pool: Hosted macOS + +- template: templates/install-ps-phase.yml + parameters: + scriptName: pwsh -c ./tools/install-powershell.ps1 -AddToPath + jobName: InstallPowerShellPS1Ubuntu + pool: Hosted Ubuntu 1604 diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 46cfacc106..06c9249bf0 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -386,7 +386,7 @@ try { if ($uid -ne "0") { $SUDO = "sudo" } else { $SUDO = "" } Write-Verbose "Make symbolic link '$symlink' point to '$targetPath'..." -Verbose - Invoke-Expression -Command "$SUDO ln -fs $targetPath $symlink" + & $SUDO ln -fs $targetPath $symlink if ($LASTEXITCODE -ne 0) { Write-Error "Could not add to PATH: failed to make '$symlink' point to '$targetPath'."