Get-TfsItemHistory Version parameter

2019-07-04 21:10发布

I wanted a way to find a distinct set of changed files from TFS from a certain date. From googling I found this article

http://blog.hackedbrain.com/2009/04/01/getting-a-distinct-list-of-changed-files-from-tfs-using-powershell/

In that article the author uses the get-tfsitemhistory cmdlet, with the -Version parameter like this

Get-TfsItemHistory “$/Foo/v1.1” -Version “D3/1/09~D3/31/09” -Recurse

From looking at get-help get-tfsitemhistory -full, there are no examples, and I get the following about -Version

-Version <String>
Specifies the version of the items for which to display revision history. By default, Team Foundation uses the
workspace version.

You cannot combine this option with the -slotmode option

Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

What I want to know is

  1. How exactly can I find out how to use the -Version parameter properly? It's a string, and from the article it looks like you specify a date range, although it doesn't say that in the help. Is there a msdn reference site where these kind of things are laid out clearly? From googling I couldn't find such a site.
  2. In general, how do Powershell power users find out how to use these cmdlets?

1条回答
Root(大扎)
2楼-- · 2019-07-04 21:57

From googling further I was able to find this forum thread

http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/f796a935-9760-4590-9335-9213be764f2f

From that I was able to find the tfs powertools powershell help documentation, specifically from the file PowerShellCmdlets.mht

In it there's a section about Version which is a lot more descriptive. It also held several examples, very useful.

-Version <String>
Optional. Specifies the version of the items that you want to retrieve. You can specify     a version by:

·         Date/time (D2008-01-21T16:00)

·         Changeset version (C1256)

·         Label (Lmylabel)

·         Latest version (T)

·         Workspace version (Wworkspacename;owner)

If you do not specify a version, Team Foundation Server retrieves the most recent server version of the specified itemspec into your workspace. 
查看更多
登录 后发表回答