diff --git a/.github/workflows/build-validation.yaml b/.github/workflows/build-validation.yaml index 85c5e6ffe..3d70ff7b8 100644 --- a/.github/workflows/build-validation.yaml +++ b/.github/workflows/build-validation.yaml @@ -41,9 +41,9 @@ jobs: if: steps.filter.outputs.pwshmodule == 'true' shell: pwsh run: | - # Pester 5.7.1+ is required for the coverage configuration used in pester.ps1. + # Pester 6.0.0-rc4 is installed explicitly because prereleases are not selected by -MinimumVersion. # Installed on every leg so behavior stays consistent across the matrix. - Install-Module Pester -MinimumVersion 5.7.1 -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber + Install-Module Pester -RequiredVersion 6.0.0-rc4 -AllowPrerelease -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber Install-Module PSFramework -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber Install-Module PSModuleDevelopment -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber Install-Module Microsoft.Graph.Authentication -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber diff --git a/.github/workflows/update-tag-documentation.yml b/.github/workflows/update-tag-documentation.yml index 6d9b2992c..b2b40e2e5 100644 --- a/.github/workflows/update-tag-documentation.yml +++ b/.github/workflows/update-tag-documentation.yml @@ -24,7 +24,7 @@ jobs: - name: Set up PowerShell modules run: | - pwsh -NoLogo -NoProfile -Command "Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck" + pwsh -NoLogo -NoProfile -Command "Install-Module Pester -RequiredVersion 6.0.0-rc4 -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck" - name: Generate tags document run: pwsh -NoLogo -NoProfile -File build/Update-TagsDocumentation.ps1 diff --git a/build/Test-PSModule.ps1 b/build/Test-PSModule.ps1 index 3b9a5f4ac..9e6290ed8 100644 --- a/build/Test-PSModule.ps1 +++ b/build/Test-PSModule.ps1 @@ -33,7 +33,7 @@ Import-Module "$PSScriptRoot\CommonFunctions.psm1" -Force -WarningAction Silentl ## Restore Module Dependencies &$PSScriptRoot\Restore-PSModuleDependencies.ps1 -ModuleManifestPath $ModuleManifestPath -PSModuleCacheDirectory $PSModuleCacheDirectoryInfo.FullName | Out-Null -Import-Module Pester -MinimumVersion 5.0.0 +Import-Module Pester -RequiredVersion 6.0.0 #$PSModule = Import-Module $ModulePath -PassThru -Force $PesterConfiguration = New-PesterConfiguration (Import-PowerShellDataFile $PesterConfigurationFileInfo.FullName) diff --git a/build/Update-CommandReference.ps1 b/build/Update-CommandReference.ps1 index 2085aa4b8..311d21519 100644 --- a/build/Update-CommandReference.ps1 +++ b/build/Update-CommandReference.ps1 @@ -4,11 +4,11 @@ if (-not (Get-Module Alt3.Docusaurus.Powershell -ListAvailable)) { Install-Module Alt3.Docusaurus.Powershell -Scope CurrentUser -Force -SkipPublisherCheck } if (-not (Get-Module PlatyPS -ListAvailable)) { Install-Module PlatyPS -Scope CurrentUser -Force -SkipPublisherCheck } -if (-not (Get-Module Pester -ListAvailable)) { Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck } +if (-not (Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq '6.0.0' })) { Install-Module Pester -RequiredVersion 6.0.0-rc4 -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck } Import-Module Alt3.Docusaurus.Powershell Import-Module PlatyPS -Import-Module Pester +Import-Module Pester -RequiredVersion 6.0.0 Import-Module DnsClient # Generate the command reference markdown diff --git a/powershell/tests/pester.ps1 b/powershell/tests/pester.ps1 index 601496adc..6f176df76 100644 --- a/powershell/tests/pester.ps1 +++ b/powershell/tests/pester.ps1 @@ -26,7 +26,7 @@ Remove-Module Maester -ErrorAction Ignore Import-Module "$PSScriptRoot\..\Maester.psd1" Import-Module PSModuleDevelopment -Import-Module Pester +Import-Module Pester -RequiredVersion 6.0.0 Write-PSFMessage -Level Important -Message "Creating test result folder" $null = New-Item -Path "$PSScriptRoot\..\.." -Name TestResults -ItemType Directory -Force