Skip to content

Commit cb82e76

Browse files
Use PowerShell Daily in CI (#2617)
1 parent b7e723b commit cb82e76

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

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

0 commit comments

Comments
 (0)