문제

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