TFS 2015 - tfpt Create new Team Project

2019-05-29 23:55发布

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'

4条回答
叼着烟拽天下
2楼-- · 2019-05-30 00:27

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

查看更多
We Are One
3楼-- · 2019-05-30 00:28

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

查看更多
Fickle 薄情
4楼-- · 2019-05-30 00:30

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.

查看更多
在下西门庆
5楼-- · 2019-05-30 00:30

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.

enter image description here

This is the same in TFS 2015

查看更多
登录 后发表回答