Create manifest for nested PowerShell modules

I have a little problem with nested PowerShell modules.

Get-Module correctly identifies ExportedCommands , but ModuleType is listed as Script , not Manifest :

 PS>get-module ModuleType Name ExportedCommands ---------- ---- ---------------- Script Bar Get-Bar Script Foo Get-Foo 

Directory structure:

 |-Modules |-Foobar |-Foobar.psd1 |-Bar |-Bar.psm1 |-Foo |-Foo.psm1 

Foobar.psd1:

 ... # Script module or binary module file associated with this manifest ModuleToProcess = '' # Modules to import as nested modules of the module specified in ModuleToProcess NestedModules = 'Foo\Foo.psm1', 'Bar\Bar.psm1' ... 

Did I structure the PSD1 file correctly? In my situation, do I need a dummy / empty file Foobar.psm1 (with the corresponding entry in the PSD1 file)? Do I need a nested directory structure, or can I just include two PSM1 files (bar.psm1 and foo.psm1) in the parent directory (Foobar)?

+4
source share
1 answer

Directory structure should be:

 |-Modules |-Foobar |-Foobar.psd1 |-Bar.psm1 |-Foo.psm1 

Foobar.psd1 should be:

 ... # Modules to import as nested modules of the module specified in ModuleToProcess NestedModules = 'Foo.psm1', 'Bar.psm1' ... 
+3
source

Source: https://habr.com/ru/post/1479581/


All Articles