Skip to main content

Add-VSTeamProfile

SYNOPSIS

Stores your account name and personal access token as a profile for use with the Add-TeamAccount function in this module.

SYNTAX

Secure (Default)

Add-VSTeamProfile [-Account] <String> -SecurePersonalAccessToken <SecureString> [[-Name] <String>]
[[-Version] <String>] [-UseBearerToken] [<CommonParameters>]

Plain

Add-VSTeamProfile [[-Account] <String>] [-PersonalAccessToken] <String> [[-Name] <String>]
[[-Version] <String>] [-UseBearerToken] [<CommonParameters>]

Windows

Add-VSTeamProfile [-Account] <String> [[-Name] <String>] [[-Version] <String>] [-UseBearerToken]
[<CommonParameters>]

DESCRIPTION

EXAMPLES

Example 1

Add-VSTeamProfile

You will be prompted for the account name and personal access token.

Example 2

Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018

Allows you to provide all the information on the command line.

Example 3

Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication

On Windows, allows you use to use Windows authentication against a local TFS server.

PARAMETERS

-Account

The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL.

Just the portion after dev.azure.com. For example in the following url mydemos is the account name. \https://dev.azure.com/mydemos\ or The full Team Foundation Server (TFS) url including the collection. \http://localhost:8080/tfs/DefaultCollection\

Type: String
Parameter Sets: Secure, Windows
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: Plain
Aliases:

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

-SecurePersonalAccessToken

A secured string to capture your personal access token.

This will allow you to provide your personal access token without displaying it in plain text.

To use pat simply omit it from the Add-VSTeamProfile command.

Type: SecureString
Parameter Sets: Secure
Aliases:

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

-PersonalAccessToken

The personal access token from AzD/TFS to use to access this account.

Type: String
Parameter Sets: Plain
Aliases:

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

-UseBearerToken

Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Name

Optional name for the profile. If this parameter is not provided the account will also serve as the name.

Type: String
Parameter Sets: (All)
Aliases:

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

-Version

Specifies the version to use. The acceptable values for this parameter are:

  • TFS2017
  • TFS2017U1
  • TFS2017U2
  • TFS2017U3
  • TFS2018
  • TFS2018U1
  • TFS2018U2
  • TFS2018U3
  • AzD2019
  • AzD2019U1
  • VSTS
  • AzD

If you are on AzD it will default to AzD otherwise it will default to TFS2017.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: TFS2017 for TFS and AzD for AzD
Accept pipeline input: False
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

Set-VSTeamAPIVersion

Set-VSTeamDefaultProject

Set-VSTeamDefaultAPITimeout

about_vsteam

about_vsteam_profiles

about_vsteam_provider