Skip to content

fix: add PS5.1 SemanticVersion shim for consistent Resolve-ModuleVersionString return type#463

Merged
HeyItsGilbert merged 1 commit into
mainfrom
fix/ps51-semantic-version-shim
May 26, 2026
Merged

fix: add PS5.1 SemanticVersion shim for consistent Resolve-ModuleVersionString return type#463
HeyItsGilbert merged 1 commit into
mainfrom
fix/ps51-semantic-version-shim

Conversation

@HeyItsGilbert
Copy link
Copy Markdown
Member

Closes #460

Summary

  • [System.Management.Automation.SemanticVersion] is PS6+ only; on PS5.1 Resolve-ModuleVersionString was falling back to [System.Version], causing two test assertions to fail
  • Adds Plaster/Private/Initialize-SemanticVersion.ps1: a top-level Add-Type shim that defines System.Management.Automation.SemanticVersion in C# when the native type is absent
  • Simplifies Resolve-ModuleVersionString to always construct SemanticVersion — the shim ensures the type exists on PS5.1 at module load time (alphabetical load order puts Initialize-SemanticVersion before Resolve-ModuleVersionString)
  • Tests require no changes

Test plan

  • Run Pester suite on PS5.1 — both Resolve-ModuleVersionString tests pass
  • Run Pester suite on PS7 — no regression

🤖 Generated with Claude Code

…turns consistent type (#460)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Test Results

  4 files  284 suites   1m 11s ⏱️
243 tests 236 ✅ 2 💤 5 ❌
972 runs  959 ✅ 8 💤 5 ❌

For more details on these failures, see this check.

Results for commit b2e162b.

@HeyItsGilbert HeyItsGilbert merged commit e3da88c into main May 26, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: add PS5.1 SemanticVersion shim so Resolve-ModuleVersionString returns a consistent type

1 participant