Context and request
Observed behavior. Every scheduled Process-PSModule run on main fails. The most recent run failed Test-Module and Test-ModuleLocal on Linux, macOS, and Windows, followed by Get-TestResults and Get-CodeCoverage. The framework's own harness aborts during discovery:
[-] Discovery in .../Test-PSModule/.../src/tests/Module/PSModule/PSModule.Tests.ps1 failed with:
System.ArgumentException: Value can not be null or empty array. If this is expected, use
-AllowNullOrEmptyForEach on this It, or set the Run.FailOnNullOrEmptyForEach configuration
option to $false to allow it for the whole run. (Parameter 'ForEach')
The run log shows Pester 6.0.1 loaded. Json has no classes and no enums, so the framework's ForEach collections are empty — which Pester 5 tolerated and Pester 6 rejects by default.
Expected behavior. The scheduled and pull-request runs succeed on all three runners.
Reproduction. Trigger Process-PSModule on main, or wait for the nightly 0 0 * * * schedule.
Environment. .github/workflows/Process-PSModule.yml pinned to PSModule/Process-PSModule@ce64918acc96dda73eb78f827036b794bfa6fa1a # v5.5.7; current release is v6.1.15. tests/Json.Tests.ps1 line 1 pins RequiredVersion = '5.8.0', which no longer matches what the runners install.
Regression. Yes. The last green run was 2026-07-29; failures start 2026-07-30 and have recurred nightly since. The last successful release was v1.2.3 on 2025-10-09.
Workaround. None. main cannot publish while the pipeline is red.
Acceptance criteria.
- A manually dispatched run on
main succeeds end to end.
Test-Module and Test-ModuleLocal pass on Linux, macOS, and Windows.
Get-CodeCoverage reports at or above the 95% target set in .github/PSModule.yml.
- The nightly scheduled run stays green.
Technical decisions
The root cause is the version pin, not the module's own tests: the failing file is PSModule.Tests.ps1 inside the Test-PSModule action, and v6 of the framework is the release that handles Pester 6. The correction is to adopt the current major, not to patch around the symptom with -AllowNullOrEmptyForEach.
The #Requires line in tests/Json.Tests.ps1 moves to the range the standard specifies rather than another exact pin, so a Pester 6 patch release does not break the build again:
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' }
Both changes ship in one pull request. Bumping the workflow without the test requirement, or the reverse, leaves main red between merges.
PR #23 and PR #26 both cover part of this. Reconcile them into one delivery — #26 is the Dependabot bump to v6.1.14, #23 additionally handles the Pester requirement — and close the redundant one rather than merging both.
Verify against v6.1.15 rather than the v6.1.14 Dependabot proposed, since a newer release exists.
Review the v6 release notes for breaking changes to .github/PSModule.yml settings before merging; the configuration schema may have changed across the major.
Implementation plan
Context and request
Observed behavior. Every scheduled
Process-PSModulerun onmainfails. The most recent run failedTest-ModuleandTest-ModuleLocalon Linux, macOS, and Windows, followed byGet-TestResultsandGet-CodeCoverage. The framework's own harness aborts during discovery:The run log shows
Pester 6.0.1loaded.Jsonhas no classes and no enums, so the framework'sForEachcollections are empty — which Pester 5 tolerated and Pester 6 rejects by default.Expected behavior. The scheduled and pull-request runs succeed on all three runners.
Reproduction. Trigger
Process-PSModuleonmain, or wait for the nightly0 0 * * *schedule.Environment.
.github/workflows/Process-PSModule.ymlpinned toPSModule/Process-PSModule@ce64918acc96dda73eb78f827036b794bfa6fa1a # v5.5.7; current release is v6.1.15.tests/Json.Tests.ps1line 1 pinsRequiredVersion = '5.8.0', which no longer matches what the runners install.Regression. Yes. The last green run was 2026-07-29; failures start 2026-07-30 and have recurred nightly since. The last successful release was v1.2.3 on 2025-10-09.
Workaround. None.
maincannot publish while the pipeline is red.Acceptance criteria.
mainsucceeds end to end.Test-ModuleandTest-ModuleLocalpass on Linux, macOS, and Windows.Get-CodeCoveragereports at or above the 95% target set in.github/PSModule.yml.Technical decisions
The root cause is the version pin, not the module's own tests: the failing file is
PSModule.Tests.ps1inside theTest-PSModuleaction, and v6 of the framework is the release that handles Pester 6. The correction is to adopt the current major, not to patch around the symptom with-AllowNullOrEmptyForEach.The
#Requiresline intests/Json.Tests.ps1moves to the range the standard specifies rather than another exact pin, so a Pester 6 patch release does not break the build again:#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' }Both changes ship in one pull request. Bumping the workflow without the test requirement, or the reverse, leaves
mainred between merges.PR #23 and PR #26 both cover part of this. Reconcile them into one delivery — #26 is the Dependabot bump to v6.1.14, #23 additionally handles the Pester requirement — and close the redundant one rather than merging both.
Verify against v6.1.15 rather than the v6.1.14 Dependabot proposed, since a newer release exists.
Review the v6 release notes for breaking changes to
.github/PSModule.ymlsettings before merging; the configuration schema may have changed across the major.Implementation plan
tests/Json.Tests.ps1to require Pester>= 6.0.0and< 7.0.0.github/workflows/Process-PSModule.ymlto the v6.1.15 commit SHA with the version tag in a trailing comment.github/PSModule.ymlschema changes and adjust the configuration if neededmainand confirm it succeeds