Module Manifests
A module manifest is a Windows PowerShell data file (.psd1) that describes the contents of a module and determines how a module is processed. The manifest file is a text file that contains a hash table of keys and values. To use the manifest in a module, place the module manifest file in the root of the module directory.
To create a module manifest, use any text editor or use the New-ModuleManifest cmdlet to create a module manifest that can be used in a module or used as a template. You can also use the Test-ModuleManifest cmdlet to verify that the files that are listed in the module manifest file actually exist in the specified paths. For more information, see the help topics for the New-ModuleManifest and Test-ModuleManifest cmdlets. For a detailed example, see How to Write a Module Manifest.
A module manifest is not required by Windows PowerShell, but you can use a module manifest to include information about the module and its author, to specify files in the module, such as nested modules, to run scripts to customize the user's environment, to load type and formatting files, define system requirements, and limit the members that the module exports.
A module manifest is required to export an assembly that is installed in the global assembly cache. A module manifest is also required for modules that support the Updatable Help feature. Updatable Help uses the HelpInfoUri key in the module manifest to find the Help information (HelpInfo XML) file that contains the location of the updated help files for the module. For more information about Updatable Help, see Supporting Updatable Help.
Sample Module Manifest
The following sample module manifest shows the keys and default values in a module manifest. This example was created by using the New-ModuleManifest cmdlet in Windows PowerShell 3.0. When creating multiple modules, you can use this cmdlet to create a manifest template that can then be modified for different modules.
For descriptions of the keys and values, see the help topic for the New-ModuleManifest cmdlet.
#
# Module manifest for module 'myManifest'
#
# Generated by: User01
#
# Generated on: 1/24/2012
#
@{
# Script module or binary module file associated with this manifest
# RootModule = ''
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = 'd0a9150d-b6a4-4b17-a325-e3a24fed0aa9'
# Author of this module
Author = 'User01'
# Company or vendor of this module
CompanyName = 'Unknown'
# Copyright statement for this module
Copyright = '(c) 2012 User01. All rights reserved.'
# Description of the functionality provided by this module
# Description = ''
# Minimum version of the Windows PowerShell engine required by this module
# PowerShellVersion = ''
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of the .NET Framework required by this module
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module
# CLRVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module
FunctionsToExport = '*'
# Cmdlets to export from this module
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = '*'
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess
# PrivateData = ''
# HelpInfo URI of this module
# HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}
See Also
A description of the ModuleList parameter is missing from the example and documentation above. The parameter is description from get-help
"Lists all modules that are packaged with this module.
Enter each module name as a string or enter a hash table with ModuleName and GUID keys. The hash table can also have an optional ModuleVersion key.
This key is designed to act as a module inventory. These modules are not automatically processed.If you omit this parameter, New-ModuleManifest creates a ModuleList key in the manifest with an empty array value."
- 11/23/2009
- cmille19