次の方法で共有


Update-ModuleManifest

Updates a module manifest file.

構文

All

Update-ModuleManifest
    [-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[]>]
    [-PrivateData <Hashtable>]
    [-Tags <String[]>]
    [-ProjectUri <Uri>]
    [-LicenseUri <Uri>]
    [-IconUri <Uri>]
    [-ReleaseNotes <String[]>]
    [-Prerelease <String>]
    [-HelpInfoUri <Uri>]
    [-PassThru]
    [-DefaultCommandPrefix <String>]
    [-ExternalModuleDependencies <String[]>]
    [-PackageManagementProviders <String[]>]
    [-RequireLicenseAcceptance]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

説明

The Update-ModuleManifest cmdlet updates a module manifest (.psd1) file.

This is a proxy cmdlet for the Update-PSModuleManifest cmdlet in the Microsoft.PowerShell.PSResourceGet. For more information, see Update-PSModuleManifest.

Example 1: Update a module manifest

This example updates an existing module manifest file. Splatting is used to pass parameter values to Update-ModuleManifest. For more information, see about_Splatting.

$Params = @{
  Path = "C:\Test\TestManifest.psd1"
  Author = "TestUser1"
  CompanyName = "Contoso Corporation"
  Copyright = "(c) 2019 Contoso Corporation. All rights reserved."
}

Update-ModuleManifest @Params

$Params is a splat that stores the parameter values for Path, Author, CompanyName, and Copyright. Update-ModuleManifest gets the parameter values from @Params and updates the module manifest, TestManifest.psd1.

パラメーター

-AliasesToExport

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

Use this parameter to restrict the aliases that are exported by the module. AliasesToExport can remove aliases from the list of exported aliases, but it can't add aliases to the list.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:True
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Author

Specifies the module author.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ClrVersion

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

Note

This setting is valid for the PowerShell Desktop edition only, such as Windows PowerShell 5.1, and only applies to .NET Framework versions lower than 4.5. This requirement has no effect for newer versions of PowerShell or the .NET Framework.

パラメーターのプロパティ

型:Version
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-CmdletsToExport

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

Use this parameter to restrict the cmdlets that are exported by the module. CmdletsToExport can remove cmdlets from the list of exported cmdlets, but it can't add cmdlets to the list.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:True
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-CompanyName

Specifies the company or vendor who created the module.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-CompatiblePSEditions

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

パラメーターのプロパティ

型:

String[]

規定値:None
指定可能な値:Desktop, Core
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Confirm

Prompts you for confirmation before running Update-ModuleManifest.

パラメーターのプロパティ

型:SwitchParameter
規定値:False
ワイルドカードのサポート:False
DontShow:False
Aliases:cf

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

Specifies a copyright statement for the module.

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False
(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DefaultCommandPrefix

Specifies the default command prefix.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Description

Specifies a description of the module.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DotNetFrameworkVersion

Specifies the minimum version of the Microsoft .NET Framework that the module requires.

Note

This setting is valid for the PowerShell Desktop edition only, such as Windows PowerShell 5.1, and only applies to .NET Framework versions lower than 4.5. This requirement has no effect for newer versions of PowerShell or the .NET Framework.

パラメーターのプロパティ

型:Version
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DscResourcesToExport

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

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ExternalModuleDependencies

Specifies an array of external module dependencies.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-FileList

Specifies all items that are included in the module.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-FormatsToProcess

Specifies the formatting files (.ps1xml) that run 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.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-FunctionsToExport

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

Use this parameter to restrict the functions that are exported by the module. FunctionsToExport can remove functions from the list of exported aliases, but it can't add functions to the list.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:True
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Guid

Specifies a unique identifier for the module. The GUID can be used to distinguish among modules with the same name.

パラメーターのプロパティ

型:Guid
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

The HelpInfo XML file supports the Updatable Help feature that was introduced in PowerShell version 3.0. It contains information about the location of the module's downloadable help files and the version numbers of the newest help files for each supported locale.

For information about Updatable Help, see about_Updatable_Help. For information about the HelpInfo XML file, see Supporting Updatable Help.

パラメーターのプロパティ

型:Uri
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-IconUri

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

パラメーターのプロパティ

型:Uri
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-LicenseUri

Specifies the URL of licensing terms for the module.

パラメーターのプロパティ

型:Uri
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ModuleList

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

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

This key is designed to act as a module inventory. The modules that are listed in the value of this key aren't automatically processed.

パラメーターのプロパティ

型:

Object[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ModuleVersion

Specifies the version of the module.

パラメーターのプロパティ

型:Version
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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 in the value.

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

パラメーターのプロパティ

型:

Object[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PackageManagementProviders

Specifies an array of package management providers.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PassThru

Returns an object representing the item with which you're working. By default, Update-ModuleManifest doesn't generate any output.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Path

Specifies the path and file name of the module manifest. Enter a path and file name with a .psd1 file name extension, such as $PSHOME\Modules\MyModule\MyModule.psd1.

If you specify the path to an existing file, Update-ModuleManifest replaces the file without warning unless the file has the read-only attribute.

The manifest should be located in the module's directory, and the manifest file name should be the same as the module directory name, but with a .psd1 extension.

You can't use variables, such as $PSHOME or $HOME, in response to a prompt for a Path parameter value. To use a variable, include the Path parameter in the command.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:0
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値: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.

To find the name of a host program, in the program, type $Host.Name.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PowerShellHostVersion

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

パラメーターのプロパティ

型:Version
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PowerShellVersion

Specifies the minimum version of PowerShell that will work with this module. For example, you can specify 3.0, 4.0, or 5.0 as the value of this parameter.

パラメーターのプロパティ

型:Version
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Prerelease

Indicates the module is prerelease.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PrivateData

Specifies data that is passed to the module when it's imported.

パラメーターのプロパティ

型:Hashtable
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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

パラメーターのプロパティ

型:ProcessorArchitecture
規定値:None
指定可能な値:None, MSIL, X86, IA64, Amd64, Arm
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ProjectUri

Specifies the URL of a web page about this project.

パラメーターのプロパティ

型:Uri
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ReleaseNotes

Specifies a string array that contains release notes or comments that you want available for this version of the script.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-RequiredAssemblies

Specifies the assembly (.dll) files that the module requires. Enter the assembly file names. PowerShell loads the specified assemblies before updating types or formats, importing nested modules, or importing the module file that is specified in the value of the RootModule key.

Use this parameter to specify all the assemblies that the module requires, including 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 as binary modules in the NestedModules key.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

パラメーターのプロパティ

型:

Object[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-RequireLicenseAcceptance

Specifies that a license acceptance is required for the module.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-RootModule

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

If a module has a manifest file and no root file has been specified in the RootModule key, the manifest becomes the primary file for the module. And, the module becomes a manifest module (ModuleType = Manifest).

To export members from .psm1 or .dll files in a module that has a manifest, the names of those files must be specified in the values of the RootModule or NestedModules keys in the manifest. Otherwise, their members aren't exported.

In PowerShell 2.0, this key was called ModuleToProcess.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Tags

Specifies an array of tags.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-VariablesToExport

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

Use this parameter to restrict the variables that are exported by the module. VariablesToExport can remove variables from the list of exported variables, but it can't add variables to the list.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:True
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-WhatIf

Shows what would happen if Update-ModuleManifest runs. The cmdlet isn't run.

パラメーターのプロパティ

型:SwitchParameter
規定値:False
ワイルドカードのサポート:False
DontShow:False
Aliases:wi

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

入力

String

出力

Object