Commit e3da88c
fix: add PS5.1 SemanticVersion shim for consistent Resolve-ModuleVersionString return type (#463)
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](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 64dc31c commit e3da88c
2 files changed
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
51 | 42 | | |
| 43 | + | |
52 | 44 | | |
0 commit comments