From 08bb1c1bf9f6cf024ca45bf1d86c3d06baad77ee Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 8 Apr 2020 11:45:51 -0700 Subject: [PATCH 1/3] Use PowerShell Daily in CI --- .vsts-ci/templates/ci-general.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 0ccaff133..a3074459b 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -2,6 +2,19 @@ parameters: pwsh: true steps: + 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: 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') From 36f0865bc2c8ee7eee4b944535dc66987feb3515 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 8 Apr 2020 11:49:36 -0700 Subject: [PATCH 2/3] add dash --- .vsts-ci/templates/ci-general.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index a3074459b..33d61aed7 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -2,7 +2,7 @@ parameters: pwsh: true steps: - powershell: | + - powershell: | Write-Host "Installing PowerShell Daily..." # Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up. From b67becb978b6079e4b40b35e6c2e6d5abcc01615 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 8 Apr 2020 11:51:57 -0700 Subject: [PATCH 3/3] Run PSVersionTable --- .vsts-ci/templates/ci-general.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 33d61aed7..f7e20037c 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -15,6 +15,9 @@ steps: 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')