Update-ModuleManifestUpdate-ModuleManifest

Atualiza um arquivo de manifesto do módulo.Updates a module manifest file.

DescriçãoDescription

O cmdlet Update-ModuleManifest atualiza um arquivo de manifesto do módulo (.psd1).The Update-ModuleManifest cmdlet updates a module manifest (.psd1) file.

ObservaçõesNotes

- <span data-ttu-id="896f6-108">DscResourcesToExport tem suporte somente na versão mais recente do PowerShell 5.0.</span><span class="sxs-lookup"><span data-stu-id="896f6-108">DscResourcesToExport is only supported on the latest PowerShell version 5.0.</span></span> <span data-ttu-id="896f6-109">Nós não poderemos atualizar o campo se você estiver executando em versões anteriores do PowerShell.</span><span class="sxs-lookup"><span data-stu-id="896f6-109">We won’t be able to update the field if you are running on lower versions of PowerShell.</span></span>

Sintaxe do cmdletCmdlet syntax

Get-Command -Name Update-ModuleManifest -Module PowerShellGet -Syntax

Referência da ajuda online sobre cmdletsCmdlet online help reference

Update-ModuleManifestUpdate-ModuleManifest

Comandos de exemploExample commands

Esse novo cmdlet é usado para ajudar a atualizar o arquivo de manifesto com valores de propriedade de entrada.This new cmdlet is used to help update manifest file with input property values. Ele usa todos os parâmetros usados por New-ModuleManifest.It takes all parameters that New-ModuleManifest does.

Percebemos que muitos autores de módulos gostariam de especificar “*” em valores exportados como FunctionsToExport, CmdletsToExport, etc. Durante a publicação de módulo na Galeria do PowerShell, comandos e funções não especificados não serão populados corretamente na Galeria.We notice that a lot of module authors would like to specify “*” in exported values such as FunctionsToExport, CmdletsToExport, etc. During module publishing to PowerShell Gallery, unspecified functions and commands will not be populated properly onto the Gallery. Portanto, sugerimos que os autores de módulos atualizem seus manifestos com valores adequados.Therefore, we suggest module authors update their manifests with proper values.

Caso tenha módulos que exportaram propriedades, Update-ModuleManifest preencherá o arquivo de manifesto especificado com informações sobre as funções, cmdlets, variáveis, etc., exportados:If you have modules that have exported properties, Update-ModuleManifest will fill the specified manifest file with information from exported functions, cmdlets, variables etc:

Get-Content -Path "C:\Temp\PSGTEST-TestPackageMetadata\2.5\PSGTEST-TestPackageMetadata.psd1"
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '2.5'
# ID used to uniquely identify this module
GUID = '610e5c5b-dc42-4eaa-8511-ebfb44066d5e'

#(Other properties removed here for Simplicity…)

# 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 = '*'
}

Após Update-ModuleManifest:After Update-ModuleManifest:

Update-ModuleManifest -Path "C:\Temp\PSGTEST-TestPackageMetadata\2.5\PSGTEST-TestPackageMetadata.psd1"
Get-Content -Path "C:\Temp\PSGTEST-TestPackageMetadata\2.5\PSGTEST-TestPackageMetadata.psd1"
#
# Module manifest for module 'NewManifest'
#
# Generated by: author name
#
# Generated on: 11/13/2015
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '2.5'
# ID used to uniquely identify this module
GUID = '610e5c5b-dc42-4eaa-8511-ebfb44066d5e'
# Functions to export from this module
FunctionsToExport = 'Get-FooFn Get-FooWF'
# Cmdlets to export from this module
CmdletsToExport = 'Test-PSGetTestCmdlet'
}

Para cada módulo, há também campos de metadados associados a ele.For each module, there are also metadata fields associated with it. Para exibir os metadados corretamente na Galeria do PowerShell, é possível usar Update-ModuleManifest para popular esses campos em PrivateData.In order to display metadata properly on PowrShell Gallery, you can use Update-ModuleManifest to populate those fields under PrivateData.

Update-ModuleManifest -Path "C:\Temp\PSGTEST-TestPackageMetadata\2.5\PSGTEST-TestPackageMetadata.psd1" -Tags "Tag1" -LicenseUri "http://license.com" -ProjectUri "http://project.com" -IconUri "http://icon.com" -ReleaseNotes "Test module"

A tabela de hash PrivateData do modelo de arquivo de manifesto tem as seguintes propriedadesPrivateData hashtable from the manifest file template has the following properties

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
    PSData = @{
        # Tags applied to this module. These help with module discovery in online galleries.
        # Tags = @()

        # A URL to the license for this module.
        # LicenseUri = ''

        # A URL to the main website for this project.
        # ProjectUri = ''

        # A URL to an icon representing this module.
        # IconUri = ''

        # ReleaseNotes of this module
        # ReleaseNotes = ''

        # External dependent modules of this module
        # ExternalModuleDependencies = ''
    } # End of PSData hashtable
} # End of PrivateData hashtable