liveBook · Manning

RequiredModules

As explained in Practical Automation with PowerShell: Effective scripting from the console to the cloud

RequiredModules is a module-manifest field that specifies modules required by a PowerShell module.

RequiredModules is a module-manifest field that declares modules a PowerShell module depends on, such as Active Directory for user-management automation. section 2.2.3

Treat the declaration as dependency metadata, not complete dependency enforcement: it may not import an unimported module or verify its version, so the .psm1 file can perform explicit checks. section 2.2.3

Explicit dependency validation

Build a required-module list, use Get-Module -ListAvailable to confirm availability, compare discovered versions with the minimum, report failures, and then call Import-Module.

How Practical Automation with PowerShell: Effective scripting from the console to the cloud covers it

How deep it goes
Defines the manifest field, then descends into explicit availability, version, and import checks in the module file.
Examples
Uses an Active Directory dependency and a Pester listing that checks availability and minimum version before importing.
What it assumes
Assumes familiarity with PowerShell modules and manifests while demonstrating dependency checks from module-file code.
What you can do after
Operate/configure module dependencies by declaring requirements and adding explicit availability and version validation.
How it connects
Connects module manifests with PowerShell modules, Import-Module, module versions, and Active Directory.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Practical Automation with PowerShell: Effective scripting from the console to the cloud. The section links point to the parts of the book it draws on.