Skip to content

Scope PSModulePath modification to publish phase in release workflow#148

Merged
blindzero merged 2 commits intorelease/v0.9.2from
copilot/sub-pr-147
Feb 7, 2026
Merged

Scope PSModulePath modification to publish phase in release workflow#148
blindzero merged 2 commits intorelease/v0.9.2from
copilot/sub-pr-147

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 7, 2026

Prepending artifacts/modules to PSModulePath in the local PSGallery validation step caused Import-Module IdLE to resolve the staged build output instead of the installed package from LocalRepo, allowing the validation gate to pass even when published packages had broken dependency wiring.

Changes

  • Save original PSModulePath before modification
  • Restore it after Publish-Module loop completes and before Install-Module/Import-Module verification
  • Scopes the path mutation to only affect publishing operations, not install/import validation
  # Ensure required modules are discoverable during Test-ModuleManifest/Publish-Module.
+ # Save original PSModulePath to restore before install/import verification.
+ $originalPSModulePath = $env:PSModulePath
  $pathSeparator = [System.IO.Path]::PathSeparator
  ...
  
  foreach ($moduleName in $publishOrder) {
    Publish-Module -Path $modulePath -Repository 'LocalRepo' -ErrorAction Stop
  }

+ # Restore original PSModulePath before install/import verification
+ # to ensure Import-Module resolves the installed package, not the staged build.
+ $env:PSModulePath = $originalPSModulePath

  # Test that IdLE can be installed and imports correctly
  Install-Module -Name 'IdLE' -Repository 'LocalRepo' -Scope CurrentUser -Force

Addresses review feedback: #147 (comment)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Restore original PSModulePath before install/import verification to ensure Import-Module resolves the installed package from LocalRepo, not the staged build output from artifacts/modules. This fixes the validation gate to properly catch broken or missing dependency wiring in published packages.

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
@blindzero blindzero marked this pull request as ready for review February 7, 2026 22:57
Copilot AI changed the title [WIP] Update module path adjustment based on feedback Scope PSModulePath modification to publish phase in release workflow Feb 7, 2026
Copilot AI requested a review from blindzero February 7, 2026 22:59
@blindzero blindzero merged commit 6ac24ba into release/v0.9.2 Feb 7, 2026
5 checks passed
@blindzero blindzero deleted the copilot/sub-pr-147 branch February 7, 2026 23:00
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.

2 participants