Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed RootModule bug #456

Merged
merged 1 commit into from
Jun 16, 2024
Merged

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Jun 10, 2024

PR Summary

Some PS modules do not specify RootModule in their psd1.
In such cases Get-Module fills in RootModule with full path to psd1, which is misleading for discovering class-based resources.
This was causing internal failures in PsDscAdapter.
This PR fixes that with explicit check for such condition and adds some tracing to make diagnostics easier.

@michaeltlombardi
Copy link
Collaborator

What about cases where people split their module code without using NestedModules?

For example, the pattern built by the DSC Community has base classes etc defined in a sub-module and has using/import statements to retrieve the code:

@anmenaga
Copy link
Collaborator Author

What about cases where people split their module code without using NestedModules?

For example, the pattern built by the DSC Community has base classes etc defined in a sub-module and has using/import statements to retrieve the code:

  1. strictly speaking this is out of scope of this particular bug;
  2. I've looked through the PSAdapter code and your example module; and looks like such cases should be handled just fine when...
  3. ... class-inheritance will be implemented.
  4. Thanks for a good example module; that will help with development.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

We can address other issues as separate PRs

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jun 16, 2024
Merged via the queue into PowerShell:main with commit 0f5f4ef Jun 16, 2024
4 checks passed
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.

3 participants