Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.186
Language: C# Updated: 2026-11-04
Command

Publish-ManagedModule

Module
PSPublishModule
Inputs
None
Outputs
PowerForge.ManagedModulePublishResult

Publishes a PowerShell module package through the managed C# module engine.

Syntax

Publish-ManagedModule
[-ApiKey <String>]
[-ApiKeyFilePath <String>]
[-Authors <String>]
[-Credential <PSCredential>]
[-Description <String>]
[-Force]
[-ManifestPath <String>]
[-Name <String>]
[-OutputDirectory <String>]
[-Path] <String>
[-ProfileName <String>]
[-ProjectUrl <String>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[[-Repository] <String>]
[-RepositoryName <String>]
[-ShowSummary]
[-SkipDependenciesCheck]
[-SkipModuleManifestValidate]
[-Tags <String[]>]
[-Version <String>]
[<CommonParameters>]
#
Parameter set: PathParameterSet
Publish-ManagedModule
[-ApiKey <String>]
[-ApiKeyFilePath <String>]
[-Credential <PSCredential>]
[-Force]
-NupkgPath <String>
[-OutputDirectory <String>]
[-ProfileName <String>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[[-Repository] <String>]
[-RepositoryName <String>]
[-ShowSummary]
[-SkipDependenciesCheck]
[<CommonParameters>]
#
Parameter set: NupkgPathParameterSet

Description

This command provides the module-publish functionality of Publish-PSResource. It can create a NuGet package from a module folder or publish an existing .nupkg file to a local folder feed or NuGet-compatible package publish endpoint.

Microsoft Artifact Registry module prefixes are not applied because the managed repository client does not yet expose a container-registry transport.

Examples

Publish a module to a local folder feed

Publish-ManagedModule -Path C:\Source\Company.Tools -Repository C:\Packages

Publish an existing package without repacking it

Publish-ManagedModule -NupkgPath C:\Packages\Company.Tools.1.2.0.nupkg -Repository CompanyFeed

Parameters

-ApiKey String optionalaliases: NuGetApiKey
API key used by NuGet-compatible package publish endpoints.
-ApiKeyFilePath String optionalaliases: ApiKeyPath, NuGetApiKeyPath
Optional path to a file containing the API key.
-Authors String optionalsets: PathParameterSet
Optional authors override.
-Credential PSCredential optional
Optional repository credential.
-Description String optionalsets: PathParameterSet
Optional description override.
-Force SwitchParameter optional
Overwrite an existing package.
-ManifestPath String optionalsets: PathParameterSet
Optional explicit module manifest path.
-Name String optionalsets: PathParameterSet
Optional package id override.
-OutputDirectory String optionalaliases: DestinationPath, OutputPath
Directory that receives the created or supplied package; it is also the local target when Repository is omitted.
-Path String requiredposition: 0aliases: ModulePathsets: PathParameterSet
Module folder to package.
-ProfileName String optional
Saved module repository profile to use instead of Repository or OutputDirectory.
-ProjectUrl String optionalsets: PathParameterSet
Optional project URL override.
-Proxy Uri optional
Optional HTTP proxy used for repository requests.
-ProxyCredential PSCredential optional
Optional proxy credential used with Proxy.
-Repository String optionalposition: 1aliases: RepositoryPath, RepositoryUri, Source
Repository URL, NuGet v3 service index, publish endpoint, or local folder feed.
-RepositoryName String optional
Friendly repository name used in output.
-ShowSummary SwitchParameter optional
Write a compact Spectre.Console summary for the publish result.
-SkipDependenciesCheck SwitchParameter optional
Skip checking RequiredModules against the target repository.
-SkipModuleManifestValidate SwitchParameter optionalsets: PathParameterSet
Skip managed manifest metadata validation before packaging.
-Tags String[] optionalsets: PathParameterSet
Optional package tags override.
-Version String optionalsets: PathParameterSet
Optional package version override.
-NupkgPath String requiredsets: NupkgPathParameterSet
Existing .nupkg file to publish without repacking a module folder.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.