A module manifest file is a PowerShell data file (.psd1) with the same name as the module directory. For example, the FileTransfer module installed with CTP3 -- which contains Cmdlets for BITS -- is in a directory called $pshome\Modules\FileTransfer and contains a manifest file called $pshome\Modules\FileTransfer\FileTransfer.psd1. Module manifests are optional, but highly recommended.
A module manifest contains a hashtable declared using the @{} hashtable literal syntax. Valid keys are listed in the following table:
Key
Required
Type
Description
ModuleToProcess
Optional
String
Script module or binary module file associated with this manifest which also becomes the root module for nested modules. If no module is specified, the manifest itself becomes the root module for nested modules.
A binary module is the new name for a snap-in DLL. v1 style snapins can be loaded this way, without having to register them first with installutil.exe; A binary module does NOT need a PSSnapIn class defined.
ModuleVersion
String convertible to System.Version
Version of the module
GUID
Unique identifier for the module which can be used to verify against the module name
Author
Identifies the author of the module
CompanyName
Identifies the company that created the module
Copyright
Module copyright
Describes the contents of the module
PowerShellVersion
Minimum required version of the PowerShell engine
CLRVersion
Minimum required version of the CLR
RequiredModules
List of module names
List of modules that must already be loaded globally (note: required modules are not loaded automatically - this could optionally be done using a script in ScriptsToProcess).
RequiredAssemblies
String array
List of assemblies that will be loaded using the same algorithm as Add-Type
ScriptsToProcess
Identifies the list of scripts to process when the module is imported. These scripts are dot sourced into the caller’s environment. Only .ps1 files can be specified.
TypesToProcess
List of .ps1xml type files to process using Update-TypeData
FormatsToProcess
List of .ps1xml format files to process using Update-FormatData
NestedModules
List of .ps1, .psm1, .psd1, and .dll files to process on Import-Module. Files are processed in the order listed. DLLs are scraped for cmdlets/providers and .ps1 script files are dot sourced into the module’s session state.
ExportedFunctions
String array, wildcards supported
List of functions to export. If not defined or if asterisk is specified, all functions imported from nested modules are re‑exported. To prevent export, use the empty string ‘’.
ExportedCmdlets
List of cmdlets to export. If not defined or if asterisk is specified, all cmdlets imported from nested modules are re‑exported. To prevent export, use the empty string ‘’.
A big change in CTP3 is that binary Cmdlets can now be scoped – previously they were always global.
ExportedVariables
List of variables to export. If not defined or if asterisk is specified, all variables imported from nested modules are re‑exported. To prevent export, use the empty string ‘’.
ExportedAliases
List of aliases to export. If not defined or if asterisk is specified, all aliases imported from nested modules are re‑exported. To prevent export, use the empty string ‘’.
PrivateData
Object
Data to be passed to the module via the manifest file.
I’ve highlighted certain things in the description that are important to note. These are the things that might trip you up.
Have fun!
Page rendered at Thursday, September 02, 2010 5:34:25 PM (Eastern Daylight Time, UTC-04:00)