我想从powershell获取最新的变更集。我可以用
做到这一点$changesetText= tf changeset /latest /server:${TFSServer} |out-string
但这需要访问整个Team Project Collection,因为变更集编号用于所有分支。有什么办法可以用/登录吗?
答案 0 :(得分:2)
$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