PowerShell Logo Small

New-ModuleManifest



This is the built-in help made by Microsoft for the command 'New-ModuleManifest', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a new module manifest.

SYNTAX


New-ModuleManifest [-Path] <String> [-AliasesToExport [<String[]>]] [-Author [<String>]] [-ClrVersion [<Version>]] [-CmdletsToExport [<String[]>]] [-CompanyName [<String>]]
[-Copyright [<String>]] [-DefaultCommandPrefix [<String>]] [-Description [<String>]] [-DotNetFrameworkVersion [<Version>]] [-DscResourcesToExport [<String[]>]] [-FileList
[<String[]>]] [-FormatsToProcess [<String[]>]] [-FunctionsToExport [<String[]>]] [-Guid [<Guid>]] [-HelpInfoUri [<String>]] [-IconUri [<Uri>]] [-LicenseUri [<Uri>]]
[-ModuleList [<Object[]>]] [-ModuleVersion [<Version>]] [-NestedModules [<Object[]>]] [-PassThru] [-PowerShellHostName [<String>]] [-PowerShellHostVersion [<Version>]]
[-PowerShellVersion [<Version>]] [-PrivateData [<Object>]] [-ProcessorArchitecture {None | MSIL | X86 | IA64 | Amd64 | Arm}] [-ProjectUri [<Uri>]] [-ReleaseNotes [<String>]]
[-RequiredAssemblies [<String[]>]] [-RequiredModules [<Object[]>]] [-RootModule [<String>]] [-ScriptsToProcess [<String[]>]] [-Tags [<String[]>]] [-TypesToProcess
[<String[]>]] [-VariablesToExport [<String[]>]] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The New-ModuleManifest cmdlet creates a new module manifest (.psd1) file, populates its values, and saves the manifest file in the specified path.


Module authors can use this cmdlet to create a manifest for their module. A module manifest is a .psd1 file that contains a hash table. The keys and values in the hash table
describe the contents and attributes of the module, define the prerequisites, and determine how the components are processed. Manifests are not required for a module.


New-ModuleManifest creates a manifest that includes all of the commonly used manifest keys, so you can use the default output as a manifest template. To add or change
values, or to add module keys that this cmdlet does not add, open the resulting file in a text editor.


Each parameter of this cmdlet (except for Path and PassThru) creates a module manifest key and its value. In a module manifest, only the ModuleVersion key is required.
Unless specified in the parameter description, if you omit a parameter from the command, New-ModuleManifest creates a comment string for the associated value that has no
effect.


In Windows PowerShell 2.0, New-ModuleManifest prompts you for the values of commonly used parameters that are not specified in the command, in addition to required parameter
values. Beginning in Windows PowerShell 3.0, it prompts only when required parameter values are not specified.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=289595
Export-ModuleMember
Get-Module
Import-Module
New-Module
Remove-Module
Test-ModuleManifest
about_Modules

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>New-ModuleManifest -Path C:\Users\User01\Documents\WindowsPowerShell\Modules\Test-Module\Test-Module.psd1 -PassThru

## Module manifest for module 'TestModule'
## 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 moduleGUID = 'd0a9150d-b6a4-4b17-a325-e3a24fed0aa9'
# Author of this moduleAuthor = 'User01'
# Company or vendor of this moduleCompanyName = 'Unknown'
# Copyright statement for this moduleCopyright = '(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 moduleFunctionsToExport = '*'
# Cmdlets to export from this moduleCmdletsToExport = '*'
# Variables to export from this moduleVariablesToExport = '*'
# Aliases to export from this moduleAliasesToExport = '*'
# 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 = ''}



This command creates a new module manifest in the file that is specified by the Path parameter. The PassThru parameter sends the output to the pipeline as well as to the
file.

The output shows the default values of all keys in the manifest.






-------------------------- EXAMPLE 2 --------------------------

PS C:\>New-ModuleManifest -PowerShellVersion 1.0 -AliasesToExport JKBC, DRC, TAC -Path C:\ps-test\ManifestTest.psd1



This command creates a new module manifest. It uses the PowerShellVersion and AliasesToExport parameters to add values to the corresponding manifest keys.






-------------------------- EXAMPLE 3 --------------------------

PS C:\>New-ModuleManifest -RequiredModules BitsTransfer,@{ModuleName="PSScheduledJob";ModuleVersion="1.0.0.0";GUID="50cdb55f-5ab7-489f-9e94-4ec21ff51e59"}



This example shows how to use the string and hash table formats of the ModuleList, RequiredModules, and NestedModules parameter. You can combine strings and hash tables in
the same parameter value.

This command commands creates a module manifest for a module that requires the BitsTransfer and PSScheduledJob modules.

The command uses a string format to specify the name of the BitsTransfer module and the hash table format to specify the name, a GUID, and a version of the PSScheduledJob
module.






-------------------------- EXAMPLE 4 --------------------------

PS C:\>New-ModuleManifest -HelpInfoUri "http://http://go.microsoft.com/fwlink/?LinkID=603"



This example shows creates a module manifest for a module that supports the Updatable Help feature. This feature allows users to use the Update-Help and Save-Help cmdlets,
which download help files for the module from the Internet and install them in the module.

The command uses the HelpInfoUri parameter to create a HelpInfoUri key in the module manifest. The value of the parameter and the key must begin with "http" or "https". This
value tells the Updatable Help system where to find the HelpInfo XML updatable help information file for the module.

For information about Updatable Help, see about_Updatable_Help (http://go.microsoft.com/fwlink/?LinkID=235801). For information about the HelpInfo XML file, see "Supporting
Updatable Help" in MSDN.






Example 5

PS C:\>Get-Module PSScheduledJob -List | Format-List -Property *

LogPipelineExecutionDetails :
FalseName :
PSScheduledJobPath : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob\PSScheduledJob.psd1
Definition :
Description :
Guid : 50cdb55f-5ab7-489f-9e94-4ec21ff51e59
HelpInfoUri : http://go.microsoft.com/fwlink/?LinkID=223911
ModuleBase : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob
PrivateData :
Version : 1.0.0.0
ModuleType :
BinaryAuthor : Microsoft Corporation
AccessMode : ReadWrite
ClrVersion : 4.0
CompanyName : Microsoft Corporation
Copyright : c Microsoft Corporation. All rights reserved.
DotNetFrameworkVersion :
ExportedFunctions : {}
ExportedCmdlets : {[New-JobTrigger, New-JobTrigger], [Add-JobTrigger, Add-JobTrigger], [Remove-JobTrigger, Remove-JobTrigger], [Get-JobTrigger,
Get-JobTrigger]...}
ExportedCommands : {[New-JobTrigger, New-JobTrigger], [Add-JobTrigger, Add-JobTrigger], [Remove-JobTrigger, Remove-JobTrigger], [Get-JobTrigger,
Get-JobTrigger]...}
FileList : {}
ModuleList : {}
NestedModules : {}
PowerShellHostName :
PowerShellHostVersion :
PowerShellVersion : 4.0
ProcessorArchitecture : None
Scripts : {}
RequiredAssemblies : {}
RequiredModules : {}
RootModule : Microsoft.PowerShell.ScheduledJob.dll
ExportedVariables : {}
ExportedAliases : {}
ExportedWorkflows : {}
SessionState :
OnRemove :
ExportedFormatFiles : {C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob\PSScheduledJob.Format.ps1xml}
ExportedTypeFiles : {C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob\PSScheduledJob.types.ps1xml}

PS C:\>Get-Module -List | Format-Table -Property Name, PowerShellVersion

Name PowerShellVersion
---- -----------------
ADDeploymentWF 4.0
AppLocker 4.0
Appx 4.0
BestPractices 4.0
BitsTransfer 4.0
BranchCache 4.0
CimCmdlets 4.0
DirectAccessClientComponents 4.0
Dism 4.0
DnsClient 4.0
International 4.0
iSCSI 4.0
IscsiTarget 4.0
Kds 4.0
Microsoft.PowerShell.Diagnostics 4.0
Microsoft.PowerShell.Host 4.0
Microsoft.PowerShell.Management 4.0…



This example shows how to get the module manifest values of a module -- essentially a "Get-ModuleManifest" command. Because the values in the module manifest are reflected
in the values of properties of the module object, you can get the module manifest values by displaying the module object properties.

The first command uses the Get-Module cmdlet to get the PSScheduledJob module. The command uses the List parameter, because the module is installed, but not imported into
the session. The command sends the module to the Format-List cmdlet, which displays all properties and values of the module object in a list.

The second command uses the Format-Table cmdlet to display the PowerShellVersion property of all installed modules in a table. The PowerShellVersion property is defined in
the module manifest.