Skip to content

Exclude dependency from RequiredModules when listed under ExternalModuleDependencies#1973

Open
anamnavi wants to merge 3 commits intomasterfrom
bugfix-externalmoduledependecies
Open

Exclude dependency from RequiredModules when listed under ExternalModuleDependencies#1973
anamnavi wants to merge 3 commits intomasterfrom
bugfix-externalmoduledependecies

Conversation

@anamnavi
Copy link
Copy Markdown
Member

@anamnavi anamnavi commented Apr 9, 2026

PSResourceGet currently requires all modules to be found/installed if present under RequiredModules, even if additionally present under ExternalModuleDependencies. RequiredModules is referred to for the following operations: Install-PSResource, Publish-PSResource and Import-Module.

Previously, PSResourceGet expected the user to not list an external dependency under RequiredModules but this breaks Import-Module. This PR addresses a fix for Install-PSResource. If the module is listed under ExternalModuleDependencies, it is skipped during installation and a verbose message is written. As the ExternalModuleDependencies metadata is not returned by the PSGallery server during Find call, it must be retrieved from the .psd1 or .ps1 metadata file for a PSResource.

#1809 also discusses checking the PSModulePath for an ExternalModule dependency and warning the user accordingly, but this PR does not address this yet.

PR Summary

PR Context

Resolves #1809

PR Checklist

@anamnavi
Copy link
Copy Markdown
Member Author

anamnavi commented Apr 9, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@anamnavi anamnavi changed the title Do not require a dependency module in RequiredModules if listed under ExternalModuleDependencies Exclude dependency from RequiredModules when listed under ExternalModuleDependencies Apr 9, 2026
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.

Install-PSResource fails with ExternalModuleDependencies

1 participant