I have an build definition that will be used for many projects. But when saving to template it's still "locked" to the project.
So I'm trying to use tfpt to clone the definition to a new project.
PS C:\> tfpt builddefinition /collection:"http://localhost:8080/tfs/DefaultCollection" /dump "Test47\*"
Querying Build Definition...
No definitions found matching 'Test47\*'.
The issue is that it doesn't find any of my build definitions, trying dump to view and * to get all, even when typing the actual name of definition it still doesn't work.
There is not a method to copy vNext build definitions from one project to another, neither tfpt command nor TFS API works. You have to use the "Save as a template" feature, however, as you figured out, it only works in the same team project not across project.
For XAML build definitions, you can use the following tfpt command to copy all build definitions from one team project to another:
tfpt builddefinition /Collection:http://tfssevername:8080/tfs/DefaultCollection /clone "Project1\*" "Project2\"