TFS Power Tool (tfpt) update datetime field syntax

225 views Asked by At

I'm attempting to use Team Foundation Power Tools to update a custom datetime field and cannot seem to find the correct syntax.

Context

  1. VS2013 with TFPT installed
  2. TFS 2013 Update 4
  3. I'm trying to do this through powershell

I've created a custom datetime field which I would like to set to a specific datetime. I can set other fields without issue, and the field is a datetime type.

I have tried the commands using Xml datetime format, and my current locale (English US) and neither seem to be acceptable.

tfpt workitem /update 1890 /fields:"Test.Common.DeployDate=6/23/2015 07:30 PM" /collection:$collection

and

tfpt workitem /update 1890 /fields:"Test.Common.DeployDate=2015-06-23T00:00:00" /collection:$collection

In both cases I receive error TF237124: Work item is not ready to save.

Has anyone been able to set datetime fields this way, and if so what is the datetime format I need to use?

1

There are 1 answers

0
GScully On

Use Get-date: $line.'Date released' has a value like 04/25/2015

$wi.Fields['myCo.yourDate'].Value = $( Get-date $line.'Date Released')

Hope that helps