Tf changeset latest with a different login

169 Views Asked by At

I want to get the latest changeset from powershell. I can do this with

$changesetText= tf changeset /latest /server:${TFSServer} |out-string 

But this requires access to whole Team Project Collection, as the changeset number is used across all branches. Is there any way I can get it with /login?

1

There are 1 best solutions below

0
On

psexec did work:

$changesetText= psexec -u ${username} -p ${password} tf changeset /latest /server:${TFSServer} |out-string

$changeset= "Changeset:"
$user= "User: "
$changeset_len=$changeset.length 

$newChangeset= $changesetText.Substring($changesetText.IndexOf($changeset) + $changeset_len, $changesetText.IndexOf($user) - $changesetText.IndexOf($changeset)- $changeset_len-1)
write-host "Last changeset number is : " $newChangeset