PowerShell / DSC

This repo is for the DSC v3 project
MIT License
133 stars 22 forks source link

Fixed RootModule bug #456

Closed anmenaga closed 2 weeks ago

anmenaga commented 3 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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.