Skip to content

Commit a29cffd

Browse files
authored
Pin major Pester version to 4 to prevent breaking changes caused by upcoming release of v5 (PowerShell#12262)
1 parent 14487bf commit a29cffd

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

.vsts-ci/misc-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
condition: succeededOrFailed()
3535
3636
- powershell: |
37-
Install-module pester -Scope CurrentUser -Force
37+
Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99
3838
displayName: Install Pester
3939
condition: succeededOrFailed()
4040

.vsts-ci/templates/nanoserver.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
continueOnError: true
3535
3636
- pwsh: |
37-
Install-module pester -Scope CurrentUser -Force
37+
Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99
3838
displayName: 'Install Pester'
3939
continueOnError: true
4040

build.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ function Restore-PSPester
689689
[ValidateNotNullOrEmpty()]
690690
[string] $Destination = ([IO.Path]::Combine((Split-Path (Get-PSOptions -DefaultToNew).Output), "Modules"))
691691
)
692-
Save-Module -Name Pester -Path $Destination -Repository PSGallery -RequiredVersion "4.8.0"
692+
Save-Module -Name Pester -Path $Destination -Repository PSGallery -MaximumVersion 4.99
693693
}
694694

695695
function Compress-TestContent {

tools/ci.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,9 @@ function Invoke-CIFinish
492492
$env:PSMsiX64Path = $artifacts | Where-Object { $_.EndsWith(".msi")}
493493

494494
# Install the latest Pester and import it
495-
Install-Module Pester -Force -SkipPublisherCheck
496-
Import-Module Pester -Force
495+
$maximumPesterVersion = '4.99'
496+
Install-Module Pester -Force -SkipPublisherCheck -MaximumVersion $maximumPesterVersion
497+
Import-Module Pester -Force -MaximumVersion $maximumPesterVersion
497498

498499
# start the packaging tests and get the results
499500
$packagingTestResult = Invoke-Pester -Script (Join-Path $repoRoot '.\test\packaging\windows\') -PassThru

0 commit comments

Comments
 (0)