From 500e21f186c6a9e3b3cdc8e5609b08f9ccb25386 Mon Sep 17 00:00:00 2001 From: sysadmin Date: Tue, 9 Jun 2026 15:10:52 +0100 Subject: [PATCH] ci(branding): force Pester 5 + use v5 config object (fix -Output ambiguity vs Pester 3) Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/build-iso-windows.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build-iso-windows.yaml b/.gitea/workflows/build-iso-windows.yaml index ad9b428..9ca239c 100644 --- a/.gitea/workflows/build-iso-windows.yaml +++ b/.gitea/workflows/build-iso-windows.yaml @@ -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