Skip to content

Commit 5ffd738

Browse files
authored
[Ignore] Install pwsh when needed in release builds (#1202)
1 parent 65bcbb1 commit 5ffd738

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: .vsts-ci/templates/release-general.yml

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
steps:
2+
- powershell: |
3+
Write-Host "Installing pwsh..."
4+
if (Get-Command pwsh -ErrorAction Ignore)
5+
{
6+
Write-Host "pwsh already installed, skipping"
7+
return
8+
}
9+
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
10+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1
11+
./install-powershell.ps1 -Destination $powerShellPath
12+
$vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH"
13+
Write-Host "sending " + $vstsCommandString
14+
Write-Host "##$vstsCommandString"
15+
displayName: Install PowerShell Core
16+
217
- pwsh: |
318
Get-ChildItem -Path env:
419
displayName: Capture environment

0 commit comments

Comments
 (0)