From 27b827113be22acb1c962f1ff9dbfd07b418468e Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 1 Jul 2026 23:48:04 +0200 Subject: [PATCH] Also fail on Pester block/container failures, not just failed tests In Pester 5 a run has three independent failure counts. Gating only on FailedCount misses FailedBlocksCount (BeforeAll/AfterAll) and FailedContainersCount (files that fail to discover/load), so a failing BeforeAll or an unloadable test file passes the build green. This adds those counts to the gate. Generated with AI (GitHub Copilot CLI). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Tasks/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/build.ps1 b/Tasks/build.ps1 index fffc786..0757b9f 100644 --- a/Tasks/build.ps1 +++ b/Tasks/build.ps1 @@ -94,5 +94,5 @@ if ($Test.IsPresent) { } $res = Invoke-Pester -Configuration $PesterConfig - if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." } + if (($res.FailedCount + $res.FailedBlocksCount + $res.FailedContainersCount) -gt 0) { throw "$($res.FailedCount) tests failed." } }