Skip to content

v1.0.8

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Jul 12:18
68e8ca7

🪲 [Fix]: Install built modules into their real manifest version folder (#19)

What

Install-PSModule copied the built module into a hard-coded .../<name>/999.0.0 folder and then Import-Moduled it. That only worked while the build pipeline stamped the 999.0.0 placeholder into every manifest. Now that Process-PSModule#326 resolves and stamps the real version at build time, the folder name (999.0.0) no longer matches the manifest ModuleVersion, so PowerShell rejects the module ("does not have a valid module manifest file") and Import-Module fails.

Change

Read the manifest ModuleVersion and install into the matching version folder. Fall back to 999.0.0 only when the manifest is unstamped (a build that opted out of version resolution), preserving the previous behaviour for that case.

Import the freshly installed manifest path with -Force -Global so a preloaded placeholder version does not keep command resolution pinned to 999.0.0.

Validation

Added tests/Install-PSModule.Tests.ps1 and wired it into Action-Test. The regression test covers real-version installation, absence of the 999.0.0 folder for stamped manifests, replacement of a preloaded 999.0.0 command, and rejection of malformed ModuleVersion values.

Local validation passed:

  • pwsh -NoProfile -File ./tests/Install-PSModule.Tests.ps1
  • Invoke-ScriptAnalyzer -Path . -Recurse -Settings .github/linters/.powershell-psscriptanalyzer.psd1
  • action-shaped run: ./src/main.ps1, Get-Module -Name Helpers -ListAvailable, then the regression script

Part of the Process-PSModule#326 "test what you ship" refactor (test-harness version-awareness). Consumed by Test-PSModule, Document-PSModule, and the Process-PSModule Test-Module job.