From acedcf14f82cf615c69b9a6097716bf1a444bc87 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 8 Apr 2020 11:56:29 -0700 Subject: [PATCH] Use PowerShell Daily in CI --- .vsts-ci/templates/ci-general.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index df1616c08d..c3b24a7397 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -1,5 +1,19 @@ steps: # Setup + - powershell: | + Write-Host "Installing PowerShell Daily..." + + # Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up. + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1 + + ./install-powershell.ps1 -Destination $powerShellPath -Daily + + # Using `prependpath` to update the PATH just for this build. + Write-Host "##vso[task.prependpath]$powerShellPath" + displayName: Install PowerShell Daily + - pwsh: '$PSVersionTable' + displayName: Display PowerShell version information - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest')