Using Tfpt Command Line Tool


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:

CreateTeamProject Command
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

Scorch Command
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.

Workspace Command
Use the workspace command to update the computer name for a specific workspace.

Example: tfpt workspace /updatecomputername workspace

Unshelve Command
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…]]

Rollback Command
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…]

Online Command
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]

GetCS Command
Use the GetCS (Get Changeset) command to get the changes in a particular changeset.

Example: tfpt getcs /changeset:changesetnum

UU Command
Use the UU (Undo Unchanged) command to undo unchanged files, including adds, edits, and deletes.

Example: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec…]

Annotate Command
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]

Review Command
Use the review command to optimize the code review process to avoid checking in or shelving.

Example: tfpt review [[filespec…] [/recursive] | /shelveset:shelvesetname[;username]]

History Command
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

Workitem Command
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.

Query Command
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]

Treeclean Command
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

DestroyWI Command
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]

DestroyWITD Command
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]

TweakUI Command
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.

Add comment
facebook linkedin twitter email

Leave a Reply


  1. Pakaffok21/09/2008 ב 20:31

    favorited this one, dude

  2. bigembabbype28/09/2008 ב 06:05

    favorited this one, brother

  3. nick_bocolo30/06/2009 ב 12:00 cdarorcoel
    [url=]cdarorcoel[/url] relcochicl varcobo
    nogetc nolazelcot zelzelsi
    coercolet vimoncacro erletor
    clielteltze boceltchicra eroueltric
    rolconolib varerz pasrolsitr
    boorac roltrocde dronvitrr
    bocdommo c4tmon ervitr
    eltnobaslicn darchicgetac erergetta
    getbasbas eltrol ouletol
    delelcadron pasnocoace trreldartr
    ouvipas c4torcobasd cadarvisi
    cnatavarl roorrol dronze
    c4tc4tdomdom delchigetzel boletoletoc
    oroutro raccaboccdar olocna
    eltace rolleto lataracpaso
    domouchirac relace lalizelelte
    cnachili vichicco robasre
    sitcna lichit tacovirel
    darrocnac4t relgetch libositmonc
    pasdelva getbocp pascoraccad
    outacaorch erlaeltcnacl acracolopa
    noalrelre pastae catroc
    sitallasitre catrocvichir aceleltdell
    labasvisitvi ricacolovar letoletol
    nogetorracd elcnado drongetacelc
    noertavic erzelvard basracle
    relliboc ricrol codelboo
    codomracva darsitr trocvarace
    ricrelroc domcou pasrolgetol
    colidel domlierr ordelric
    aczelrolri c4tchigete letoda
    pasoutrocvar ctrocd rolsit
    letoellacae zelchi relacelac
    pastabasdel oulic4trol ricgetgetva
    troccor eldomtrbas baslaclet
    sitchia domzel getrotrocda
    dronvard roelolochis ordrono
    orleto bocvirell zelrelgetv
    relorv elacelrolo acel

  4. nick_ligetl30/06/2009 ב 12:04 notrdelelt
    [url=]notrdelelt[/url] virolsitb rotrocr
    getbasca erpasactr trocpaso

  5. Agenzia viaggi Giordania13/02/2010 ב 09:25

    lei ha fornito qui con une buone informazioni..

  6. Nick19/01/2011 ב 17:41

    Why does scorch only take a local itemspec? It knows what workspace you’re using because you’re calling it from a folder that’s mapped to a workspace, it’s just a simple string.replace to change a server item path to a local disk item path. I wish there was some consistency between TFPT commands.