# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @("TCMABL\Player.dll")
Then use the ModuleList element to list all modules packaged with this module. Note – your nested modules do not have to be packaged with your module. But if you want to ensure it is present it may be a good idea to package them together.
# List of all modules packaged with this module ModuleList = @("TCMABL\TCMABL.psm1","TCMABL\Player.dll")
That is it. Now the nested module will be available as long your original module is loaded. But the nested module itself won’t be listed as loaded if you do a Get-Module. But rest assured, it’s there and ready for use.
For fun, let's prove it!
First, clear all loaded modules:
Get-Module | Remove-Module
Import just the nested module. (I am not using relative paths in this example, but you can)
Import-Module .\TCMABL\Player.dll Get-Module
In order for the object type to no longer be available you have to restart the PowerShell instance. Close and open the ISE or whatever you are using for you PowerShell development. If you try to instantiate the custom object now, it won't work unless you have the module package present in your $env:PSModulePath.
Now load your PowerShell module that has this .dll listed as a nested module and do a Get-Module. Notice only the PowerShell module I imported is now available.
Notice you don't see the NestedModule listed but you can still instantiate the custom object!