Q:

Is there any automated way to create a collection and project in TFS 2018

I am curious to know is there any way to create a collection and project in TFS 2018 in an automated way.
Similar to how we can do in Bitbucket, using the API.
I tried most of the option provided in the internet. But no use.
I am using Visual Studio 2017 and TFS 2018.
Thanks

A:

Unfortunately, there is no automated way to create a team project collection, you have to Create Team Project Collection in TFS Administration Console. But you can use the TFSConfig Collection command to attach, detach, delete, or clone a team project collection. See Collection command [TFSConfig].
For team projects, you can create team projects from the command line or scripts using the VSTS CLI. VSTS CLI works with VSTS and Team Foundation Server 2017 Update 2 and later. You could install VSTS CLI, read the get started article to begin using it, and refer to the vsts project command.

