Skip to main content

Add-VSTeamNuGetEndpoint

SYNOPSIS

Adds a new NuGet service endpoint.

SYNTAX

SecureApiKey (Default)

Add-VSTeamNuGetEndpoint -EndpointName <String> [-NuGetUrl] <String> -SecureApiKey <SecureString>
-ProjectName <String> [<CommonParameters>]

ClearToken

Add-VSTeamNuGetEndpoint -EndpointName <String> [-NuGetUrl] <String> -PersonalAccessToken <String>
-ProjectName <String> [<CommonParameters>]

ClearApiKey

Add-VSTeamNuGetEndpoint -EndpointName <String> [-NuGetUrl] <String> -ApiKey <String> -ProjectName <String>
[<CommonParameters>]

SecurePassword

Add-VSTeamNuGetEndpoint -EndpointName <String> [-NuGetUrl] <String> -Username <String>
-SecurePassword <SecureString> -ProjectName <String> [<CommonParameters>]

SecureToken

Add-VSTeamNuGetEndpoint -EndpointName <String> [-NuGetUrl] <String> -SecurePersonalAccessToken <SecureString>
-ProjectName <String> [<CommonParameters>]

DESCRIPTION

The cmdlet adds a new connection between TFS/AzD and a NuGet server using the NuGet connection type.

This is only used when using the NuGet tasks.

EXAMPLES

Example 1

$apikey = Read-Host -Prompt 'ApiKey' -AsSecureString
ApiKey: ************************************
Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey

This will add a project name MyProject with no description using the Scrum process template and Git source control.

PARAMETERS

-NuGetUrl

URL of the NuGet server.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PersonalAccessToken

Authentication Token generated by NuGet.

Type: String
Parameter Sets: ClearToken
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ApiKey

Authentication ApiKey generated by NuGet.

Type: String
Parameter Sets: ClearApiKey
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Username

Username to use with basic authentication.

Type: String
Parameter Sets: SecurePassword
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EndpointName

The name displayed on the services page. In AzD this is the Connection Name.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-SecureApiKey

A secured string to capture your sensitive information.

This will allow you to provide your information without displaying it in plain text.

Type: SecureString
Parameter Sets: SecureApiKey
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SecurePersonalAccessToken

A secured string to capture your sensitive information.

You must provide on the command line. You will not be prompted for this value.

You can use $p = Read-Host -AsSecureString to capture to pass in as parameter.

Type: SecureString
Parameter Sets: SecureToken
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SecurePassword

A secured string to capture your sensitive information.

Type: SecureString
Parameter Sets: SecurePassword
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProjectName

Specifies the team project for which this function operates.

You can tab complete from a list of available projects.

You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Prerequisites:

Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.

tips:

  • check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
  • use Set-VSTeamDefaultProject to set default project for every call
  • use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
  • use Profiles to load an account and the correct version

Get-VSTeamServiceEndpoint

Get-VSTeamServiceEndpointType

Remove-VSTeamServiceEndpoint