|
1 | 1 | 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 | + |
2 | 17 | - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
|
3 | 18 | displayName: Set Build Name for Non-PR
|
4 | 19 | condition: ne(variables['Build.Reason'], 'PullRequest')
|
|
0 commit comments