Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vNext TFS 2015 QueryBuildDefinition function in powershell not finding my build definition

Trying to call the following within a PowerShell script which is called from a new vNext Build step:

$buildDef = $buildServer.QueryBuildDefinitions($project) 

Would have thought that this would return all the build definitions in my project. It only returns my XAML definitions, not my new vNext Build Definitions.
Do I need to use a different function to do this?

Want to get the list of my changesets in the last build since the last good build.

Previously I would have done something like the following:

$workspace = $buildDef.Workspace.Mappings[0].ServerItem 

and then passed this $workspace into the QueryHistory function.

like image 983
MartinaRaf Avatar asked Dec 09 '25 00:12

MartinaRaf


1 Answers

The XAML build system (and basically everything else in the "old" TFS object model) uses a SOAP API. The SOAP API is slowly being replaced with a REST API, at least for newer things.

Thus, the task-based build system does not have a SOAP API. It has a REST API. You can access it from C# code either by querying the REST API directly or by using the Team Foundation Server Client NuGet package.

like image 157
Daniel Mann Avatar answered Dec 10 '25 17:12

Daniel Mann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!