Using Tfpt Command Line Tool
I’m doing a lot demonstrations for clients and for each client I create a new Team Project.
Create new Team Project in Team System is very slow and long.
Today I said Enough!
I’ll Create Team Project from now on from Command Line!
Beside creating New Team Project there is a lot of useful commands like:
Update workitem values from a file, Delete GlobalList, Destroy WIT and more….
Team Foundation Server 2008 Power Tool (tfpt.exe) is a command-line tool.
To use these commands, start tfpt.exe at the Command Prompt. Some of the commands will display a graphical user interface when used. Team Foundation Server Power Tool includes the following commands:
Use the createteamproject command to create a team project on a TFS server. **Note: this command requires Team Foundation Server 2008 Team Explorer SP1 to be installed.
Example : tfpt /server:ServerName /teamproject:ProjectName /sitetitle:ProjectSiteTitle /sourcecontrol:New|None|BranchPath /processtemplate:templatesname
Use the scorch command to ensure that source control and local disk are identical. Your local disk will be scanned for items which are not in source control. These items will be deleted from disk, just as in tfpt treeclean. Additionally, items determined to be different on disk from those in source control will be redownloaded from the server. Items with pending changes are exempted.
Use the workspace command to update the computer name for a specific workspace.
Example: tfpt workspace /updatecomputername workspace
Use the unshelve command to unshelve and merge the changes in the workspace.
Example: tfpt unshelve [shelvesetname[;username]] [/nobackup] [/noprompt [/prefer:(local|shelved)] [/automerge:(all|none)] [/move] [/recursive] [itemspec...]]
Use the rollback command to roll back changes that have already been committed to Team Foundation Server.
Example: tfpt rollback [/changeset:changesetnum] [/recursive] [/noprompt [/automerge:(all|none)]] [filespec...]
Use the online command to create pending edits on writable files that do not have pending edits.
Example: tfpt [/deletes] [/adds] [/diff] [/noprompt [/preview] [/purge]] [/exclude:filespec1,filespec2,...] [filespec...] [/recursive]
Use the GetCS (Get Changeset) command to get the changes in a particular changeset.
Example: tfpt getcs /changeset:changesetnum
Use the UU (Undo Unchanged) command to undo unchanged files, including adds, edits, and deletes.
Example: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec...]
Use the annotate command to download all versions of the specified files and show information about when and who changed each line in the file.
Example: tfpt annotate [/noprompt] filespec[;versionspec]
Use the review command to optimize the code review process to avoid checking in or shelving.
Example: tfpt review [[filespec...] [/recursive] | /shelveset:shelvesetname[;username]]
Use the history command to display the revision history for one or more files and folders. The /followbranches option returns the history of the file branch’s ancestors.
Example: tfpt history [/version:versionspec] [/stopafter:number] [/recursive] [/user:username] [/followbranches] [/format:(brief|detailed)] [/slotmode] filespec
Use the workitem command to create, update, or view work items.
Creating a new Bug work item with a title of ‘New’ and assigned to Jason
tfpt workitem /new project1\Bug /fields:”Title=New;Assigned To=Jason”
Updating work item 123 with field values from a file
tfpt workitem /update 123 /fields:@myFieldValues.txt
Updating all work items assigned to me to be assigned to Jason (uses Query)
tfpt query /format:id “project1\public\My Work Items” | tfpt workitem
/update @ /fields:”Assigned To=Jason”
fieldN The name of a field to update.
valueN The value to set on the fieldN.
filename The file that has the field/value pairs to use.
Use the query command to run a work item query and display the results. If you do not provide a specific query, all the active work items assigned to you are displayed.
Example: tfpt query [/format:[tsv|xml|id]] [/include:header,data,count] [storedquery | /wiqfile:filename | /wiql:wiql]
Use the treeclean command to view and optionally delete files that are not under source control in the current directory and all subdirectories. This command is useful when you want to remove temporary files from your local workspace, such as files created by the compiler.
Example: tfpt treeclean -delete
Use the destroywi command to destroy one or more work items. Currently, work items can only be deleted. Destroying a work item means the work item is physically deleted and cannot be restored.
Example: tfpt destroywi /server:tfsservername /workitemid:value1[,value2,...] [/noprompt]
Use the destroywitd command to destroy a work item type. Currently, work item types can only be deleted. Destroying a work item type means that work items of that type are physically deleted and cannot be restored.
Example: tfpt destroywitd /server:tfsservername /project:projname /workitemtype:witdname [/noprompt]
Use the tweakUI command to modify Team Explorer client connection values. This command enables you set various connection settings. In addition, this command enables you to define the client certificate needed to connect to a Team Foundation Server that has been configured to require client-side certificates.