Current folder from MyModule.psd1
perspective is the folder where you keep all files, so it should work as soon as you remove (not existing) folder MyModule
from Nestedmodules
path.
Mix cmdlets from assembly and psm1 within a single Module manifest
-
29-03-2022 - |
Question
I have a C# project containing some custom cmdlets and a module manifest that loads them specifying the assembly as RootModule (I'm using PowerShell 3.0).
I'd need to add some cmdlets written in a psm1 file and I would like to export them within the same ModuleManifest.
For instance, if the Module is named MyModule, I tried something like this in my MyModule.psd1:
RootModule = '.\MyModule.dll'
...
NestedModules = @('MyModule\MyModule.psm1')
All files (MyModule.psd1, MyModule.dll and MyModule.psm1) are contained in a MyModule directory in a path referenced by the PSModulePath string.
The module is loaded with all cmdlets from the assembly, but I can't see the exported functions (Export-ModuleMember -Function "*") from the .psm1 file. Is it possible what I'm trying to do? If yes, how?
Thanks
No correct solution
OTHER TIPS