Summary
Modules are an important part of PowerShell as they encapsulate related functions (and other content). You can publish modules to public repositories such as the PowerShell Gallery, or any internal PowerShell repositories that may be in use.
Module layout in PowerShell is flexible beyond the creation of a psm1
file (or a dll
file in the case of a binary module).
You can optionally include a psd1
file to describe information about the module, including versions, what should be made available to anyone importing the module, and other metadata such as project information.
Multi-file module layouts are common as they allow authors to manage content in separate files rather than a single monolithic root module. Some module authors choose to merge content into a single file as part of a publishing process, while others are happy to load individual files via the root module.
You can use module scope to store the information a module needs to work; for example, authentication...