Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Publish-NugetPackage

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

Pushes NuGet packages to a feed using dotnet nuget push.

Remarks

Searches the provided -Path roots for *.nupkg files and pushes them using the .NET SDK. Use -SkipDuplicate for CI-friendly, idempotent runs.

Examples

Authored help example

Publish all packages from a Release folder

PS>


Publish-NugetPackage -Path '.\bin\Release' -ApiKey $env:NUGET_API_KEY -SkipDuplicate
        

Publishes all .nupkg files under the folder; safe to rerun in CI.

Publish to a custom feed

PS>


Publish-NugetPackage -Path '.\artifacts' -ApiKey 'YOUR_KEY' -Source 'https://api.nuget.org/v3/index.json'
        

Use a different source URL for private feeds (e.g. GitHub Packages, Azure Artifacts).

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.

Syntax

Publish-NugetPackage -ApiKey <String> -Path <String[]> [-SkipDuplicate] [-Source <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

ApiKey String requiredposition: namedpipeline: False
API key used to authenticate against the NuGet feed.
Path String[] requiredposition: namedpipeline: False
Directory to search for NuGet packages.
SkipDuplicate SwitchParameter optionalposition: namedpipeline: False
When set, passes --skip-duplicate to dotnet nuget push. This makes repeated publishing runs idempotent when the package already exists.
Source String optionalposition: namedpipeline: False
NuGet feed URL.

Outputs

System.Object