使用现有的空数据库创建团队项目集合 [英] Create a team project collection using existing empty database

查看:102
本文介绍了使用现有的空数据库创建团队项目集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有以下示例电源shell脚本来创建团队项目集合,它正常工作。


[Reflection.Assembly] :: LoadFile(" ; C:\Program Files(x86)\ Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.TeamFoundation.Client.dll"); [Reflection.Assembly] :: LoadFile(" C:\Program Files(x86)\ Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.TeamFoundation.Common.dll");
[Reflection.Assembly] :: LoadFile(" C:\Program Files(x86)\ Mysoftoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.VisualStudio.Services.Client.dll" ); [Reflection.Assembly] :: LoadFile(" C:\Program Files(x86)\ Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.VisualStudio.Services.Common.dll");


$ instanceBaseUrl =" http:// TFSserver:8080 / tfs /" ;; $ tfsServer = new-object Microsoft.TeamFoundation.Client.TfsConfigurationServer $ instanceBaseUrl;


$ tpcSvc = $ tfsServer.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamProjectCollectionService]); $ job = $ tpcSvc.QueueCreateCollection(" SampleMyCollectionNameTest_1215",#collection name。


"",#description。


$ false,#不要将它设为默认集合。


"〜/ SampleMyCollectionNameTest_1215 /",#virtual directory。


" ;开始",#创建后状态。


$ null,#no tokens。


" Server = SLQ \ Instance; Integrated Security = SSPI;",#用于创建集合的SQL实例。如果不使用默认实例,则指定SERVER \INSTANCE


$ null,#null因为集合数据库不存在已经存在。


$ null)#null因为集合数据库尚不存在。


$ collection = $ tpcSvc.WaitForCollectionServicingToComplete( $ job $。





但是如何使用power shell脚本用现有的空数据库创建新项目集合??

解决方案

Hi venkata,


感谢您在此发帖。


创建使用现有空数据库的集合,您可以更改以下代码:

 


tpcSvc =


tfsServer.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamProjectCollectionService]);

I have below sample power shell script to create team project collection which is working fine.

[Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.TeamFoundation.Client.dll"); [Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.TeamFoundation.Common.dll"); [Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.VisualStudio.Services.Client.dll"); [Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TestAgent\Microsoft.VisualStudio.Services.Common.dll");

$instanceBaseUrl = "http://TFSserver:8080/tfs/"; $tfsServer = new-object Microsoft.TeamFoundation.Client.TfsConfigurationServer $instanceBaseUrl;

$tpcSvc = $tfsServer.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamProjectCollectionService]); $job = $tpcSvc.QueueCreateCollection( "SampleMyCollectionNameTest_1215", # collection name.

"", # description.

$false, # don't make this the default collection.

"~/SampleMyCollectionNameTest_1215/", # virtual directory.

"Started", # State after creation.

$null, # no tokens.

"Server=SLQ\Instance;Integrated Security=SSPI;", # The SQL instance to create the collection on. Specify SERVER\INSTANCE if not using default instance

$null, # null because the collection database doesn't already exist.

$null) # null because the collection database doesn't already exist.

$collection = $tpcSvc.WaitForCollectionServicingToComplete($job).

But how to create new project collection with the existing empty database by using power shell script...?

解决方案

Hi venkata,

Thank you for posting here.

To create a collection using an existing empty database, you could change your code like the following:


tpcSvc =


tfsServer.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamProjectCollectionService]);


这篇关于使用现有的空数据库创建团队项目集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆