'Custom Powershell Nested Class not Found

I've got 3 files with custom PS classes.

NestedClass.psm1
ChildClass.psm1
ParentClass.psm1

Inside ParentClass I've got the following code: using Module ".\ChildClass.psm1"

And I can see the classes inside ChildClass.

Inside ChildClass I've got the following code: using Module ".\NestedClass.psm1"

And I can see what's inside NestedClass from inside ChildClass. The problem is I can't see any Nested classes from the Parent class file.

I've tried a number of things including manifest files where I define: RequiredModules = @('NestedClass.psd1') and ScriptsToProcess = @('NestedClass.ps1') and NestedModules = @('NestedClass.psd1')

No matter what I do I can't seem to get the nested classes to be seen in the parent class file.

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source