سؤال

My Machine houses many changesets of source control. I am trying to find what changeset a specific folder belong to in TFS.

I can use powershell to retrieve all changesets. Using the developer command prompot for VS2012, I can run this command to retrieve the current changeset on my machine. I want to combine the two so I can get that from the powershell script. I'd rather to find the equivalent of that developer command in powershell.

Any ideas?

هل كانت مفيدة؟

المحلول

Here is the code I came up with:

Set-Location -Path codepath 
$exepath = "D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe"
$result = & $exepath history . /r /noprompt /stopafter:1 /version:W
"$result" -match "\d+"

the changeset number is here: $matches[0]

نصائح أخرى

Use Get-TfsItemHistory e.g.

Get-TfsItemHistory .\Build

That will show you which changesets impacted that dir.

Another way to do this if you are using a server path rather than a local path:

$svr = Get-TfsServer http://tfs.acme.com:8080/tfs/acme
Get-TfsItemHistory $/Acme/Trunk/Build -Server $svr
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top