Skip to content

Add opt-in isolated module resolution preference#423

Merged
PrzemyslawKlys merged 2 commits into
mainfrom
codex/isolated-module-resolution-preference
Jun 7, 2026
Merged

Add opt-in isolated module resolution preference#423
PrzemyslawKlys merged 2 commits into
mainfrom
codex/isolated-module-resolution-preference

Conversation

@PrzemyslawKlys
Copy link
Copy Markdown
Member

Summary

  • add Import-IsolatedModule -PreferIsolatedModulePath as an opt-in process-scoped resolution preference
  • prepend the generated isolated module work path to PSModulePath only after the isolated import succeeds
  • expose the selected resolution path in -PassThru output and document the downstream-module workflow

Why

Some consumer modules call Import-Module ExchangeOnlineManagement internally after the caller already connected through an isolated Exchange profile. By default, those nested imports can resolve the original installed module again and bypass the isolated copy. This switch gives callers an explicit way to prefer the generated isolated module path for later name-based imports in the same PowerShell process, without changing default behavior.

Validation

  • dotnet test .\PowerForge.Tests\PowerForge.Tests.csproj -c Release --filter "IsolatedModuleImportServiceTests|ModuleIsolationScriptPatcherTests|ModuleIsolationProfileRegistryTests"
  • dotnet build .\PowerForge.PowerShell\PowerForge.PowerShell.csproj -c Release -f net472 --nologo
  • .\Module\Build\Build-Module.ps1 -NoDotnetBuild
  • pwsh -NoLogo -NoProfile -File .\Module\PSPublishModule.Tests.ps1
  • no-auth smoke: Import-IsolatedModule -Profile ExchangeOnlineManagement -PreferIsolatedModulePath -PassThru, then a later Import-Module ExchangeOnlineManagement resolved from the generated isolated work path

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7f0e5021

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@PrzemyslawKlys PrzemyslawKlys merged commit 7639924 into main Jun 7, 2026
6 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the codex/isolated-module-resolution-preference branch June 7, 2026 08:38
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.

1 participant