Link to home
Start Free TrialLog in
Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland

asked on

in powershell, can we have several .psm1 files for a module ?

Hello,

I'm writing some powershell. In order to get things cleaner i decided to write my code in modules.
So far i always work the same way :

1. I create a folder inside C:\Program Files\WindowsPowerShell\Modules\
2. I create a file with the same name as the folder in inside.
3. I invoke the create manifest file command.
4. I reference the psm1 - file with code - in the psd1.

question:
how can i add more psm1 files inside a module.

thank you in advance.

Erwin .
ASKER CERTIFIED SOLUTION
Avatar of Guy Lidbetter
Guy Lidbetter
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Erwin Pombett

ASKER

Hello Guy Lidbetter,

thank you for your answer.

yes ! that's my necessity ;) i dont want to create a single psm1 per module and i was wondering if we could add more on the RootModule configuration variable but you answered to my question.

*** Question :
Do this means that by removing the module and importing it,  all code in files : the one referenced by the configuration variable Rootmodule and also those under Nested modules will be refresh ?

Thank you in advance for this last info.
If you update ANY of the modules in the nest, or the manifest you would have to manually reload the module (PSD1) in order to use them.

Regards

Guy