Connect-TfsTeamProjectCollection
Connects to a TFS team project collection or Azure DevOps organization.
Table of Contents
Syntax
Cached credentials
Connect-TfsTeamProjectCollection
[-Collection] <object>
-Cached
[-Passthru]
[-Server <object>]
User name and password
Connect-TfsTeamProjectCollection
[-Collection] <object>
[-UserName] <string>
[-Password <SecureString>]
[-Passthru]
[-Server <object>]
Credential object
Connect-TfsTeamProjectCollection
[-Collection] <object>
-Credential <object>
[-Passthru]
[-Server <object>]
Personal Access Token
Connect-TfsTeamProjectCollection
[-Collection] <object>
-PersonalAccessToken <string>
[-Passthru]
[-Server <object>]
Prompt for credential
Connect-TfsTeamProjectCollection
[-Collection] <object>
[-Interactive]
[-Passthru]
[-Server <object>]
Description
The Connect-TfsTeamProjectCollection cmdlet connects to a TFS Team Project Collection or Azure DevOps organization. That connection can be later reused by other TfsCmdlets commands until it’s closed by a call to Disconnect-TfsTeamProjectCollection.
Examples
Example 1
Connects to a collection called “DefaultCollection” in a TF server called “tfs” using the cached credentials of the logged-on user
PS> Connect-TfsTeamProjectCollection -Collection http://tfs:8080/tfs/DefaultCollection
Example 2
Connects to a collection called “DefaultCollection” in a Team Foundation server called “tfs”, firstly prompting the user for credentials (it ignores the cached credentials for the currently logged-in user). It’s equivalent to the command: Connect-TfsTeamProjectCollection -Collection http://tfs:8080/tfs/DefaultCollection -Credential (Get-TfsCredential -Interactive)
PS> Connect-TfsTeamProjectCollection -Collection http://tfs:8080/tfs/DefaultCollection -Interactive
Parameters
Specifies that cached (default) credentials should be used when possible/available.
Type | SwitchParameter |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL.
Type | object |
Position | 0 |
Default Value | (N/A) |
Accept pipeline input | True (byvalue) |
Accept wildcard characters | False |
Specifies a user account that has permission to perform this action. To provide a user name and password, a Personal Access Token, and/or to open a input dialog to enter your credentials, call Get-TfsCredential with the appropriate arguments and pass its return to this argument.
Type | object |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Prompts for user credentials. Can be used for any Team Foundation Server or Azure DevOps account - the proper login dialog is automatically selected. Should only be used in an interactive PowerShell session (i.e., a PowerShell terminal window), never in an unattended script (such as those executed during an automated build). Currently it is only supported in Windows PowerShell.
Type | SwitchParameter |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Returns the results of the command. By default, this cmdlet does not generate any output.
Type | SwitchParameter |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Specifies a password for authentication modes (such as Basic) that support username/password-based credentials. Must be used in conjunction with the -UserName argument
Type | SecureString |
Position | 2 |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
-PersonalAccessToken (Aliases: Pat)
Specifies a personal access token, used as an alternate credential, to authenticate to Azure DevOps
Type | string |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Specifies the URL to the Team Foundation Server to connect to, a TfsConfigurationServer object (Windows PowerShell only), or a VssConnection object. When omitted, it defaults to the connection set by Connect-TfsConfiguration (if any). For more details, see the Get-TfsConfigurationServer cmdlet.
Type | object |
Position | (Named) |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Specifies a user name for authentication modes (such as Basic) that support username/password-based credentials. Must be used in conjunction with the -Password argument
Type | string |
Position | 1 |
Default Value | (N/A) |
Accept pipeline input | False |
Accept wildcard characters | False |
Inputs
System.Object
Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL.