Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Push NuGet Package

Publishes a NuGet package file to a NuGet package source.

Script usage:

NuGet::Push-Package(
	FilePath: <text>,
	[To: <text>],
	[FeedUrl: <text>],
	[UserName: <text>],
	[Password: <text>],
	[ApiKey: <text>],
	[NuGetExePath: <text>],
	[PreferNuGetExe: <true/false>],
	[AdditionalArguments: <text>],
	[EnsureDotNetInstalled: <text>],
	[DotNetPath: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
Package file name (default)
text
FilePath
Value note: "example: myPackage-1.0.0.nupkg". This argument is required.
Package source
text
To
NuGet server URL
text
FeedUrl
Not specifying will "Use server URL from package source".
User name
text
UserName
Not specifying will "Use user name from package source".
Password
text
Password
Not specifying will "Use password from package source".
NuGet API Key
text
ApiKey
Not specifying will "Use API Key from package source".
NuGet.exe path
text
NuGetExePath
Full path to NuGet.exe on the target server. When not set, the included nuget.exe will be used. This will only be used if dotnet is not available on a Windows server or PreferNuGetExe is set to true. Default value is "$NuGetExePath".
Prefer NuGet.exe
true/false
PreferNuGetExe
When true, NuGet.exe will be used when run on Windows if it is available, even if dotnet is also available.
Additional arguments
text
AdditionalArguments
Ensure dotnet installed
text
EnsureDotNetInstalled
This uses Microsoft's dotnet-install script to ensure that the specified version is installed. Values other than "auto" will be passed to the Channel parameter. The "auto" value will attempt to determine the SDK your project uses and ensure that it is installed. Value note: "not set (do not install)".
dotnet path
text
DotNetPath
Full path of dotnet.exe (or dotnet on Linux). This is usually C:\Program Files\dotnet\dotnet.exe on Windows. If no value is supplied, the operation will default to %PROGRAMFILES%\dotnet\dotnet.exe for Windows and dotnet (from the path) on Linux. Value note: "default".