Edit

Share via


Update-PSModuleManifest

Updates a module manifest file.

Syntax

Default (Default)

Update-PSModuleManifest
    [-Path] <String>
    [-NestedModules <Object[]>]
    [-Guid <Guid>]
    [-Author <String>]
    [-CompanyName <String>]
    [-Copyright <String>]
    [-RootModule <String>]
    [-ModuleVersion <Version>]
    [-Description <String>]
    [-ProcessorArchitecture <ProcessorArchitecture>]
    [-CompatiblePSEditions <String[]>]
    [-PowerShellVersion <Version>]
    [-ClrVersion <Version>]
    [-DotNetFrameworkVersion <Version>]
    [-PowerShellHostName <String>]
    [-PowerShellHostVersion <Version>]
    [-RequiredModules <Object[]>]
    [-TypesToProcess <String[]>]
    [-FormatsToProcess <String[]>]
    [-ScriptsToProcess <String[]>]
    [-RequiredAssemblies <String[]>]
    [-FileList <String[]>]
    [-ModuleList <Object[]>]
    [-FunctionsToExport <String[]>]
    [-AliasesToExport <String[]>]
    [-VariablesToExport <String[]>]
    [-CmdletsToExport <String[]>]
    [-DscResourcesToExport <String[]>]
    [-Tags <String[]>]
    [-ProjectUri <Uri>]
    [-LicenseUri <Uri>]
    [-IconUri <Uri>]
    [-ReleaseNotes <String>]
    [-Prerelease <String>]
    [-HelpInfoUri <Uri>]
    [-DefaultCommandPrefix <String>]
    [-ExternalModuleDependencies <String[]>]
    [-RequireLicenseAcceptance]
    [-PrivateData <Hashtable>]
    [<CommonParameters>]

Description

This cmdlet updates the data stored in a module manifest file. The parameters allow you to specify which properties get updated. Update-PSModuleManifest overwrites any existing values in the module manifest.

The cmdlet doesn't return an object.

Examples

Example 1

This example changes the Author property in the module manifest to New Author.

Update-PSModuleManifest -Path 'C:\MyModules\TestModule' -Author 'New Author'

Example 2

This example changes the Prerelease property to beta2.

Update-PSModuleManifest -Path 'C:\MyModules\TestModule' -Prerelease 'beta2'

Example 3

This example updates multiple properties.

$parameters = @{
    Path = 'C:\MyModules\TestModule'
    Tags = 'Windows', 'Linux'
    Description = 'A module for managing packages.'
}
Update-PSModuleManifest

Parameters

-AliasesToExport

Specifies the aliases that the module exports. Wildcards are permitted.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Author

Specifies the module author.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClrVersion

Specifies the minimum version of the Common Language Runtime (CLR) of the Microsoft .NET Framework required by the module.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CmdletsToExport

Specifies the cmdlets that the module exports. Wildcards are permitted.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CompanyName

Specifies the company or vendor who created the module.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CompatiblePSEditions

Specifies the compatible PSEditions of the module. For information about PSEdition, see Modules with compatible PowerShell Editions.

Parameter properties

Type:

String[]

Default value:None
Accepted values:Desktop, Core
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Specifies a copyright statement for the module.

Type:String
Default value:None
Supports wildcards:False
DontShow:False
(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultCommandPrefix

Specifies the default command prefix.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies a description of the module.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DotNetFrameworkVersion

Specifies the minimum version of the Microsoft .NET Framework required by the module.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DscResourcesToExport

Specifies the Desired State Configuration (DSC) resources that the module exports. Wildcards are permitted.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExternalModuleDependencies

Specifies an array of external module dependencies.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FileList

Specifies all items that are included in the module.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FormatsToProcess

Specifies the formatting files (.ps1xml) that are processed when the module is imported.

When you import a module, PowerShell runs the Update-FormatData cmdlet with the specified files. Because formatting files aren't scoped, they affect all session states in the session.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FunctionsToExport

Specifies the functions that the module exports. Wildcards are permitted.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Guid

Specifies a unique identifier for the module. The GUID is used to distinguish between modules with the same name.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HelpInfoUri

Specifies the internet address of the module's HelpInfo XML file. Enter a Uniform Resource Identifier (URI) that begins with http: or https:.

For more information, see Updatable Help.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IconUri

Specifies the URI of an icon for the module. The specified icon is displayed on the gallery web page for the module.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LicenseUri

Specifies the URL of licensing terms for the module.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ModuleList

Specifies an array of modules that are included in the module.

Enter each module name as a string or as a hashtable with ModuleName and ModuleVersion keys. The hashtable can also have an optional GUID key. You can combine strings and hashtables in the parameter value.

This key is designed to act as a module inventory.

Parameter properties

Type:

Object[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ModuleVersion

Specifies the version of the module.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NestedModules

Specifies script modules (.psm1) and binary modules (.dll) that are imported into the module's session state. The files in the NestedModules key run in the order in which they're listed.

Enter each module name as a string or as a hashtable with ModuleName and ModuleVersion keys. The hashtable can also have an optional GUID key. You can combine strings and hashtables in the parameter value.

Parameter properties

Type:

Object[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

Specifies the path and filename of the module manifest. Enter filename with a .psd1 file extension.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PowerShellHostName

Specifies the name of the PowerShell host program that the module requires. Enter the name of the host program, such as PowerShell ISE Host or ConsoleHost. Wildcards aren't permitted.

The name of a host program is stored in $Host.Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PowerShellHostVersion

Specifies the minimum version of the PowerShell host program that works with the module. Enter a version number, such as 1.1.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PowerShellVersion

Specifies the minimum version of PowerShell that works with this module. For example, you can specify versions such as 5.1 or 7.2.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Prerelease

Specifies the prerelease value that's appended to the module version. For example, if Prerelease is preview and the ModuleVersion is 1.0.0, the version of the module is 1.0.0-preview.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrivateData

Specifies data that's passed to the module when it's imported. This can be any arbitrary values stored in a hashtable.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProcessorArchitecture

Specifies the processor architecture that the module requires.

The acceptable values for this parameter are:

  • Amd64
  • Arm
  • IA64
  • MSIL
  • None (unknown or unspecified)
  • X86

Parameter properties

Type:ProcessorArchitecture
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProjectUri

Specifies the URI of a web page about this project.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReleaseNotes

Specifies a string that contains release notes or comments for the module.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RequiredAssemblies

Specifies the assembly (.dll) files required by the module. PowerShell loads the specified assemblies before updating types or formats, importing nested modules, or importing the module file specified in the RootModule key.

Use RequiredAssemblies for assemblies that must be loaded to update any formatting or type files that are listed in the FormatsToProcess or TypesToProcess keys, even if those assemblies are also listed in the NestedModules key.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RequiredModules

Specifies modules that must be in the global session state. If the required modules aren't in the global session state, PowerShell imports them. If the required modules aren't available, the Import-Module command fails.

The value can be an array containing module names or module specifications. A module specification is a hashtable that has the following keys.

  • ModuleName - Required Specifies the module name.
  • GUID - Optional Specifies the GUID of the module.
  • It's also Required to specify at least one of the three below keys.
    • ModuleVersion - Specifies a minimum acceptable version of the module.
    • MaximumVersion - Specifies the maximum acceptable version of the module.
    • RequiredVersion - Specifies an exact, required version of the module. This can't be used with the other Version keys.

Parameter properties

Type:

Object[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RequireLicenseAcceptance

Specifies that a license acceptance is required for the module.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RootModule

Specifies the primary or root file of the module. Enter the filename of a script (.ps1), a script module (.psm1), a module manifest (.psd1), an assembly (.dll), or a cmdlet definition XML file (.cdxml). When the module is imported, the members exported from the root module are imported into the caller's session state.

If a module has a manifest file and no file is specified in the RootModule key, the manifest becomes the primary file for the module. The module is known as a manifest module (ModuleType = Manifest).

To export members from .psm1 or .dll files, the names of those files must be specified in the values of the RootModule or NestedModules keys in the manifest.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ScriptsToProcess

Specifies script (.ps1) files that run in the caller's session state when the module is imported. You can use these scripts to prepare an environment, just as you might use a login script.

To specify scripts that run in the module's session state, use the NestedModules key.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tags

Specifies an array of tags.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Tag

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TypesToProcess

Specifies the type files (.ps1xml) that run when the module is imported.

When you import the module, PowerShell runs the Update-TypeData cmdlet with the specified files. Because type files aren't scoped, they affect all session states in the session.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VariablesToExport

Specifies the variables that the module exports. Wildcards are permitted.

Use this parameter to restrict which variables that are exported by the module.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

Object

Notes

For a full description of the module manifest file, see about_Module_Manifests.