Invoke-CreatePackage

Description

Builds a NuGet package based on a csproj or nuspec file and publishes it to a NuGet feed.

Syntax

Invoke-CreatePackage -PackageDefinitionFile <String> -Version <String> [-Suffix <String>] -OutputDirectory <String> [-Publish]
[-Source <String>] [-ApiKey <String>] [-ToolsPath <String>] [<CommonParameters>]

Parameters

Name

Alias

Description

Required?

Pipeline Input

Default Value

PackageDefinitionFile


Full path to a package definition file, which can either be a csproj or nuspec file.

true

false


Version


Package semantic version number, e.g. "1.2.3".

true

false


Suffix


Pre-release suffix, e.g. "pre1234".

false

false


OutputDirectory


Output directory where the .nupkg file will land.

true

false


Publish


Set to true to push/publish the package to a NuGet feed.

false

false

False

Source


NuGet feed destination for package publishing.

false

false


ApiKey


NuGet feed API Key for package publishing.

false

false


ToolsPath


Path to download and store nuget.exe if not already present in the path.

false

false


Examples

EXAMPLE 1
$parameters = @{

PackageDefinitionFile = "c:\\temp
EdFi.Installer.WebApi.nuspec"
Version = "1.0.0"
Suffix = "pre0001"
OutputDirectory = "c:
temp"
Publish = $true
Source = "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
ApiKey = $env:azureArtifacts.apiKey
ToolsPath = "tools"
}
Invoke-CreatePackage @parameters