Repository navigation
Install the Pester version requested by the Version input #68
Copy link
Copy link
Closed
Labels
Description
Activity
- added 9 commits that reference this issue
on Jul 5, 2026 MariusStorhaug commented
on Jul 9, 2026 MemberAuthorMore actionsHeads-up: PR #71 delivers the core of this issue but takes a different approach to the version-spec syntax than described here, and defers the GUID part. Recording what shipped vs. what this issue asked for.
What changed vs. the request
- Version-spec syntax: instead of a
#Requires -Modules @{ ModuleName = …; ModuleVersion = …; MaximumVersion = …; RequiredVersion = …; GUID = … }hashtable, theVersioninput takes NuGet version-range syntax — the same syntaxInstall-PSResource -Versionaccepts natively. Examples:6.0.0(exact),[6.0.0](exact),[5.0.0,6.0.0)(range),[6.0.0,](minimum),(,7.0.0)(maximum). The value is passed straight through toInstall-PSResource -Version, so there is no hashtable-translation layer. This also keeps the input consistent with PSModule/GitHub-Script'sVersioninput, which adopted the same NuGet-range model in Support NuGet version range syntax for the Version input GitHub-Script#97 / 🚀 [Feature]: Version input accepts NuGet version ranges GitHub-Script#98. - GUID identity pinning: deferred. The optional
GUIDpin/validation from this issue is not implemented in 🌟 [Major]: Version and Prerelease inputs now control Pester #71.
What matches the acceptance criteria
Version: '6.0.0'installs and runs exactly Pester 6.0.0 even when a newer version exists on the Gallery — covered by the newAction-Test - [Pester 6.0.0 Exact Constraint]CI job. ✅- Minimum/range specs install the newest version satisfying the spec — verified:
Install-PSResource -Version '[low,high]'resolves to the highest match. ✅ Install-PSResourceWithRetrygained-Versionand-Prerelease;init.ps1/exec.ps1pass the spec through. ✅- Deterministic load: the resolved version is imported with
Import-Module -RequiredVersion, and the install fails fast if the constraint cannot be satisfied from what is installed — so a preinstalled copy on the runner cannot silently win. ✅ Prereleaseis honored; no auto-resolve from test files; an emptyVersionkeeps installing latest (backward compatible). ✅GUID, when supplied, is validated against the installed module. ❌ (deferred)
Also in #71 (tangential to this issue)
VersionandPrereleasewere reassigned to control Pester; the init bootstrap module's controls moved toGitHubVersion/GitHubPrerelease. That is the breaking change in 🌟 [Major]: Version and Prerelease inputs now control Pester #71 and is unrelated to this issue's ask, but it is why those inputs now mean something different.
Remaining
- The only acceptance-criterion not delivered is optional GUID identity pinning. Suggest either keeping this issue open scoped down to just the GUID pin, or closing it (core delivered by 🌟 [Major]: Version and Prerelease inputs now control Pester #71) and opening a focused follow-up for GUID — happy to do whichever you prefer.
Implemented in #71.
- Version-spec syntax: instead of a
- changed the title
[-]🚀 [Feature]: Install the pinned Pester version — support #Requires-style version constraints on the Version input[/-][+]Install the Pester version requested by the Version input[/+]on Jul 9, 2026 MariusStorhaug commented
on Jul 9, 2026 MemberAuthorMore actionsRestructured the issue into the standard three-section format (context and request → technical decisions → implementation plan).
- Retitled from the
🚀 [Feature]:prefix form to an imperative summary; categorization stays on theMinorlabel. - Rewrote the request from the user's perspective (behavior, impact, acceptance criteria) and moved all implementation detail into Technical decisions.
- Folded in the decisions actually made in 🌟 [Major]: Version and Prerelease inputs now control Pester #71: NuGet version-range syntax (not a
#Requires -Moduleshashtable), straight pass-through toInstall-PSResource, deterministic import with fail-fast, and GUID pinning deferred. - The implementation plan marks the core as delivered by 🌟 [Major]: Version and Prerelease inputs now control Pester #71 and leaves the optional
GUIDidentity pin as the one remaining task.
- Retitled from the
- added a commit that references this issue
on Jul 9, 2026
Invoke-Pesterruns in CI to test PowerShell modules. Test files and module manifests pin the Pester version they expect — for example through#Requires -Modules@{ ModuleName = 'Pester'; RequiredVersion = '5.7.1' }— on the assumption that the pinned version is the one that runs.Request
Desired capability
The
Versioninput determines which Pester version the action installs and runs, so a workflow can pin an exact version or a compatible window and have that be the version that actually executes the tests.Prereleaseopts into prerelease versions.Today the action installs the latest Pester regardless of any pin, so exact pins cannot hold. On 2026-07-05 this caused a failure: test files pinned Pester
5.7.1, the runner installed5.8.0, and discovery failed withCould not load file or assembly 'Pester, Version=5.7.1.0'. Hard-pinning the tests to an exact version does not help either — the next Pester release becomes "latest" and the pin no longer matches what is installed.This is the linchpin of the hard-lock dependency model (PSModule/Process-PSModule#356): a pin only holds if the pinned version is what actually gets installed.
Acceptance criteria
Versionare unaffected and keep installing the latest version.#Requiresfrom test files to infer a version.Related: repositories hard-locking Pester by GUID
PSModule/GitHub#636, PSModule/Context#118, PSModule/Ast#41, PSModule/Dns#18, PSModule/Json#20, PSModule/NerdFonts#83, PSModule/Net#14, PSModule/PSCustomObject#15
Technical decisions
Constraint syntax — NuGet version ranges, not a
#Requires -Moduleshashtable. TheVersioninput accepts NuGet version-range syntax — the same syntaxInstall-PSResource -Versionaccepts — rather than a#Requires -Modules @{ ModuleVersion = …; MaximumVersion = … }hashtable. A bare version (6.0.0) is exact;[6.0.0]is exact;[5.0.0,6.0.0)is a bounded range;[6.0.0,]is a minimum;(,7.0.0)is a maximum. This keeps the value a straight pass-through toInstall-PSResourcewith no translation layer, and matches theVersioninput on PSModule/GitHub-Script (PSModule/GitHub-Script#97, PSModule/GitHub-Script#98) so the two actions behave the same way.Resolution. A range installs the newest version satisfying it (confirmed against
Install-PSResource). An emptyVersioninstalls the latest available version, preserving current behavior.Deterministic load. After install, the resolved version is imported with
Import-Module -RequiredVersion, so the loaded module is deterministic even when the runner ships a different preinstalled Pester. When a constraint is set but no satisfying installed version can be resolved, the action fails fast rather than importing an unconstrained module.No auto-resolve. The action does not read
#Requiresfrom test files; the spec comes only from the input.GUID identity pin — deferred. The optional GUID validation is not part of the first delivery; it is tracked as remaining work below.
Placement.
Install-PSResourceWithRetry(in the action's helper module) gains-Versionand-Prerelease;init.ps1andexec.ps1read the inputs and pass the spec through.Test approach. Action-Test jobs exercise a Pester 5.x range (
[5.0.0,6.0.0)) and an exact Pester6.0.0pin.Implementation plan
Core — delivered in #71
-Versionand-PrereleasetoInstall-PSResourceWithRetryand pass them toInstall-PSResource.Import-Module -RequiredVersion; fail fast when a constraint cannot be satisfied.Version/Prereleaseininit.ps1andexec.ps1and pass the spec through.Version→ latest" default for backward compatibility.Get-Module.6.0.0pin.Remaining
GUIDmodule-identity pin, validated against the installed module.