Publish-PowerShellGalleryModule

Publishes a module to the PowerShell gallery.

Syntax

Publish-PowerShellGalleryModule [-ManifestPath] <String> [-ModulePath] <String> [-ReleaseNotesPath] <String> [[-Name] <String>] [[-ApiKey] <String>] [-LicenseUri] <String> [[-Tags] <String[]>] [[-ProjectUri] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

The Publish-PowerShellGalleryModule functin publishes a module to the PowerShell Gallery. If the given version of the module already exists in the Gallery, a warning is written and no other work is done.

If you don't supply a PowerShell Gallery API key via the ApiKey parameter, you'll be prompted for it.

Returns a PSGetItemInfo object if the module gets published (the object returned by the Find-Module cmdlet). If the version of the module already exists in the Gallery, you'll get a warning that the module has already been published.

This function requires the PowerShellGet module. If it isn't available, you'll get an error.

Parameters

Name Type Description Required? Pipeline Input Default Value
ManifestPath String

Path to the module's manifest.

true false
ModulePath String

The path to the module.

true false
ReleaseNotesPath String

The release notes.

true false
Name String

The name of the module being published. Defaults to the name in the module manifest.

false false
ApiKey String

The API key for the PowerShell Gallery.

false false
LicenseUri String

The URL to the module's license.

true false
Tags String[]

Any tags for the module.

false false
ProjectUri String

The URL to the project's home page.

false false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

Return Values

PSGetItemInfo.

EXAMPLE 1

Publish-PowerShellGalleryModule -Name 'Carbon' -Version '2.0.0' -LicenseUri ''http://www.apache.org/licenses/LICENSE-2.0'