通过PowerShell为TFS2010项目添加贡献者,有谁知道如何做到这一点?感谢
答案 0 :(得分:1)
观看powershell文档(C:\ Program Files(x86)\ Microsoft Team Foundation Server 2010 Power Tools \ Help \ PowerShellCmdlets.mht),看起来没有选项可以将用户添加到TFS中的组。但是,如果安装了TFS Power Tools,则可以在命令行中使用tfssecurity工具。
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tfssecurity /?
[...]
/g+ groupIdentity memberIdentity (/collection:CollectionURI | /server:ServerURI)
Adds a user or a group to an existing group.
[...]
Identity Specifiers:
sid:sid - References the identity with the specified SID.
Example: sid:S-1-5-21-2127521184-1604012920-1887927527-588340
n:[domain\]name - References the identity with the specified name. For Windows, name is the logon name. If the referenced identity is in a domain, the domain name is required. For application groups, name is the group display name and domain is the URI or GUID of the containing project. In this context, if domain is omitted, the scope is assumed to be collection-level.
Example: To reference the identity of the user "John Peoples" in the domain "Datum1" at the fictitious company "A. Datum Corporation, you would use the following syntax:
n:DATUM1\jpeoples
Example: To reference application groups, you could use either of the following syntaxes:
n:"Full-time Employees"
n:00a10d23-7d45-4439-981b-d3b3e0b0b1ee\Vendors
[...]
所以它看起来像:
tfssecurity /g+ [ProjectName]\Contributor Domain\UserName /collection:http://yourTfs:8080/ProjectCollection