TFS 2015 - tfpt Create new Team Project

折月煮酒 提交于 2019-12-23 04:01:39

问题


Trying to create a powershell script to create a new project in Team Foundation Server 2015.

When running the script I get the message:

The project collection does not have a default location for creating project portal sites configured. Either configure this location using the Team Foundation Administration Console or specify the /webapplication and /relativepath arguments.

Any suggestions, I want to create a new git repository instead of needing to use Visual Studio.

My create new project script.

[CmdletBinding()]
Param(
  [Parameter(Mandatory=$True,Position=1)]
   [string]$name
)
Write-Host "Create new project: $name";
tfpt createteamproject /collection:'http://localhost:8080/tfs/DefaultCollection' /teamproject:"$name" /processtemplate:'scrum' /sourcecontrol:'NewGitRepo'

回答1:


If you need to create a new Git repository, there's no need to create a new Team Project. You can add as many Git repos as you want to a single project.

In the web portal, visit the "Code" tab, click on the active repository (in the top left) and click on the "New Repository" button.




回答2:


To extend Daniel Manns answer:

You can add new repositories to an existing Team Project from the project administration page using the New Repository button

http://tfsserver:8080/tfs/[CollectionName]/[ProjectName]/_admin/_versioncontrol

There does not seem to be any way to create a new Team Project nor add a new repository using TFPT, but the latter is possible thanks to this:

TfsGitAdmin

You will end up with a repo url something like

http://tfsserver:8080/tfs/[CollectionName]/[ProjectName]/_git/[NewProjectName]


One (possibly major) downside to adding a repository this way is that it doesn't seem to be accessible to Code Reviews, at least not in TFS 2013.

The new repository is a bit difficult to find through the Portal interface. It's hiding under the (usually redundant) Team Project dropdown.

This is the same in TFS 2015




回答3:


just add the /noportal parameter, which indicates that the project does not require site in Sharepoint. It worked for me.




回答4:


You need details for the SharePoint configuration. Try to run the script with adding arguments?
[/webapplication:http://sharepoint.domain.local] and [/relativepath:/sites/DefaultCollection/MyProject].
You can checkout msdn site and an old but still relevant blog



来源:https://stackoverflow.com/questions/33671586/tfs-2015-tfpt-create-new-team-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!