문제

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

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top