ci(branding): force Pester 5 + use v5 config object (fix -Output ambiguity vs Pester 3)
Some checks failed
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Failing after 46s
Some checks failed
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Failing after 46s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -111,11 +111,20 @@ jobs:
|
||||
- name: Test branding module (Pester)
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Windows ships Pester 3.x; force Pester 5 (the tests use v5 syntax).
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted -ErrorAction SilentlyContinue
|
||||
if (-not (Get-Module -ListAvailable Pester | Where-Object Version -ge '5.0.0')) {
|
||||
if (-not (Get-Module -ListAvailable Pester | Where-Object { $_.Version -ge [version]'5.0.0' })) {
|
||||
Install-Module Pester -MinimumVersion 5.0 -Scope CurrentUser -Force -SkipPublisherCheck
|
||||
}
|
||||
$r = Invoke-Pester windows/tests/Branding.Tests.ps1 -PassThru -Output Detailed
|
||||
Get-Module Pester | Remove-Module -Force -ErrorAction SilentlyContinue
|
||||
Import-Module Pester -MinimumVersion 5.0 -Force
|
||||
Write-Host "Using Pester $((Get-Module Pester).Version)"
|
||||
# v5 configuration object — avoids the v3/-Output param ambiguity.
|
||||
$cfg = New-PesterConfiguration
|
||||
$cfg.Run.Path = 'windows/tests/Branding.Tests.ps1'
|
||||
$cfg.Run.PassThru = $true
|
||||
$cfg.Output.Verbosity = 'Detailed'
|
||||
$r = Invoke-Pester -Configuration $cfg
|
||||
if ($r.FailedCount -gt 0) { throw "$($r.FailedCount) branding test(s) failed" }
|
||||
|
||||
- name: Build packed ISO
|
||||
|
||||
Reference in New Issue
Block a user