You can store connection information in profiles so that you do not have to specify it every time that you perform a version-control command. A connection profile contains information such as the URL of a version-control server for Team Foundation, proxy information, and authentication credentials. You can create a profile by providing only its name and the URL of the version-control server.
In this topic
You can create a profile by using the -new option with the profile command.
The following example creates a profile that is named john@tfs01 and stores the URL of the version-control server (http://tfs01.xyz.example.com/tfs/DefaultCollection), the user name (john), and the domain name (company). For this example, the name of the profile reflects the name of the user and of the server, but you can give your profiles any names that you want.
tf profile –new john@tfs01 \
Names of profile properties, such as serverUrl or userName, are case-sensitive. You must use the correct property names and types when you set properties.
The following example creates the same profile as in the previous example but includes a password that is quoted for shell compatibility.
tf profile -new john@tfs01 \
-string:userName=john -string:userDomain=company -string:password="Se^%cret1”
Properties such as serverUrl, userName, and userDomain require string values. Properties such as httpProxyEnabled require Boolean or numeric values that you specify by using the –boolean or the –number options.
This following example shows how to set many properties in a profile that is called john@tfs01-proxied. The command is wrapped over many lines so that the options are easier to read.
tf profile -new john@tfs01-proxied \
You can find the list of profile properties, their types, and brief descriptions by running the tf help profile command.
You can access a profile by using the –profile option when you run a tf command. In the following example, the workspaces command uses the authentication information from the john@tfs01 profile:
tf workspaces –profile:john@tfs01
You can use the –login option to override the credentials that are stored in a connection profile. However, you must update each profile manually if information changes.
You can edit a profile by using the –edit option with the profile command and specifying the name of the profile that you want to edit. You can change only those properties that you specify with this option.
The following example disables the HTTP proxy in the profile that is named john@tfs01-proxied.
tf profile –edit john@tfs01-proxied -boolean:httpProxyEnabled=false
You can remove a property from a profile by using the –edit option and supplying an empty value for the property name.
The following example removes the tfProxyUrl property from the john@tfs01 profile.
tf profile –edit john@tfs01 –string:tfProxyUrl=