Geeks With Blogs



Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.


Lance's TextBox » About Me » My Resume »Twitter

Here is the simple function I added to my powershell profile:




function create-tfstask ($desc) {
 tfpt workitem /new $workItemType /collection:$serverUrl /fields:"Title=$($desc);Assigned To=$assignee;AreaId=$areaId;IterationId=$iterationId"



To find the AreaId and IterationId for your project/versions, just look at a bug you know is setup correctly:

PS C:\> tfpt query /collection:http://3bs001vsteam:8080/tfs /wiql:"select AreaId,IterationId from workitems where ID = 879"

Next I hooked this into my existing "todo" function by adding a new case in its $target switch statement for “tfs”, which calls my create-tfstask function and returns.  Updated todo function:

function todo {
  param([string] $target = "work",
        [string] $msg )
  $emailFrom = ""
  #combine all the cmd line args into one "message"
  if ($args -ne "") {
    $msg = $msg + " " + $args
  #what is the target of the message?
  switch ($target)
    "work" { $target = "" }
    "home" { $target = "" }
    "tfs" { create-tfstask $msg; return }
  $subject = "Todo: " + $msg
  $body = $msg
  $smtpServer = "3bs001exch"	
  $smtp = new-object Net.Mail.SmtpClient($smtpServer, 25)
  $smtp.Send($emailFrom, $target, $subject, $body)
Technorati Tags: ,,
Posted on Wednesday, January 26, 2011 10:58 AM Programming , PowerShell | Back to top

Comments on this post: Creating Team Foundation Work Items With PowerShell

# re: Creating Team Foundation Work Items With PowerShell
Requesting Gravatar...
prosesor dual-core 1.5 Ghz Snapdragon S3 CPU dengan layar SAMOLED ukuran 4 inchi, kamera belakang 5MP dengan kemampuan merekam video 720P, kamera depan 1.3MP, dan akan beroperasi dengan Android 2.3 Gingerbread. Mengenai konektivitas, ponsel rental sewa mobil bogor ini sudah mendukung 42Mbps HSPA+. Ponsel ini juga akan diberikan aplikasi bawaan seperti DropBox, Evernote, Square, TripIt, Camscanner dan LinkedIn untuk membantu produktivitas pengguna. Sayangnya belum ada informasi mengenai ketersediaan Galaxy S Blaze 4G ini di Indonesia
Left by rental sewa mobil bogor on Mar 01, 2012 12:52 AM

Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: | Join free