From a29cffd49d319cf8b6cb68ad4528a35aefd0819d Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 14 Apr 2020 07:21:19 +0100 Subject: [PATCH] Pin major Pester version to 4 to prevent breaking changes caused by upcoming release of v5 (#12262) --- .vsts-ci/misc-analysis.yml | 2 +- .vsts-ci/templates/nanoserver.yml | 2 +- build.psm1 | 2 +- tools/ci.psm1 | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.vsts-ci/misc-analysis.yml b/.vsts-ci/misc-analysis.yml index 0e4093b6f9..e35b508bfd 100644 --- a/.vsts-ci/misc-analysis.yml +++ b/.vsts-ci/misc-analysis.yml @@ -34,7 +34,7 @@ jobs: condition: succeededOrFailed() - powershell: | - Install-module pester -Scope CurrentUser -Force + Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99 displayName: Install Pester condition: succeededOrFailed() diff --git a/.vsts-ci/templates/nanoserver.yml b/.vsts-ci/templates/nanoserver.yml index d7575836f8..c989d01c2f 100644 --- a/.vsts-ci/templates/nanoserver.yml +++ b/.vsts-ci/templates/nanoserver.yml @@ -34,7 +34,7 @@ jobs: continueOnError: true - pwsh: | - Install-module pester -Scope CurrentUser -Force + Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99 displayName: 'Install Pester' continueOnError: true diff --git a/build.psm1 b/build.psm1 index 86c7acd50b..70dc91d90a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -689,7 +689,7 @@ function Restore-PSPester [ValidateNotNullOrEmpty()] [string] $Destination = ([IO.Path]::Combine((Split-Path (Get-PSOptions -DefaultToNew).Output), "Modules")) ) - Save-Module -Name Pester -Path $Destination -Repository PSGallery -RequiredVersion "4.8.0" + Save-Module -Name Pester -Path $Destination -Repository PSGallery -MaximumVersion 4.99 } function Compress-TestContent { diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 854da9da3f..047753805b 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -492,8 +492,9 @@ function Invoke-CIFinish $env:PSMsiX64Path = $artifacts | Where-Object { $_.EndsWith(".msi")} # Install the latest Pester and import it - Install-Module Pester -Force -SkipPublisherCheck - Import-Module Pester -Force + $maximumPesterVersion = '4.99' + Install-Module Pester -Force -SkipPublisherCheck -MaximumVersion $maximumPesterVersion + Import-Module Pester -Force -MaximumVersion $maximumPesterVersion # start the packaging tests and get the results $packagingTestResult = Invoke-Pester -Script (Join-Path $repoRoot '.\test\packaging\windows\') -PassThru