Skip to content

Commit d8b6a62

Browse files
Use PowerShell Daily in CI (#1252)
* Use PowerShell Daily in CI * add dash * Run PSVersionTable
1 parent 0e9b982 commit d8b6a62

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.vsts-ci/templates/ci-general.yml

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ parameters:
22
pwsh: true
33

44
steps:
5+
- powershell: |
6+
Write-Host "Installing PowerShell Daily..."
7+
8+
# Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up.
9+
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
10+
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1
11+
12+
./install-powershell.ps1 -Destination $powerShellPath -Daily
13+
14+
# Using `prependpath` to update the PATH just for this build.
15+
Write-Host "##vso[task.prependpath]$powerShellPath"
16+
displayName: Install PowerShell Daily
17+
18+
- pwsh: '$PSVersionTable'
19+
displayName: Display PowerShell version information
20+
521
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
622
displayName: Set Build Name for Non-PR
723
condition: ne(variables['Build.Reason'], 'PullRequest')

0 commit comments

Comments
 (0)