简体   繁体   English

vNext TFS 2015在PowerShell中的QueryBuildDefinition函数找不到我的构建定义

[英]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: 尝试在从新的vNext构建步骤调用的PowerShell脚本中调用以下内容:

$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. 它只返回我的XAML定义,而不是我的新vNext构建定义。
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. 然后将此$workspace传递给QueryHistory函数。

The XAML build system (and basically everything else in the "old" TFS object model) uses a SOAP API. XAML构建系统(以及“旧”TFS对象模型中的其他所有内容)都使用SOAP API。 The SOAP API is slowly being replaced with a REST API, at least for newer things. SOAP API正逐渐被REST API取代,至少对于新的东西而言。

Thus, the task-based build system does not have a SOAP API. 因此,基于任务的构建系统没有SOAP API。 It has a REST API. 它有一个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 . 您可以通过直接查询REST API或使用Team Foundation Server Client NuGet包从C#代码访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过powershell获取压缩的TFS 2015(vNext)构建输出日志(就像构建后的下载链接一样) - Get zipped TFS 2015 (vNext) build output logs through powershell (just like the download link after the build) TFS2015 vNext Build + PowerShell自定义—异常调用保存:TF215070:构建URI无效 - TFS2015 vNext Build + PowerShell Customization — Exception calling Save: TF215070: The build URI is not valid TFS 2017 vNext Build使用Powershell获得工作空间 - TFS 2017 vNext Build Get workspace with powershell 用于构建 TFS 定义的 PowerShell 脚本 - PowerShell Script to Build TFS Definition TFS vNext Powershell构建步骤正在使用旧版本的Powershell模块 - TFS vNext Powershell build step is using older version of Powershell module 如何从Powershell脚本中向TFS vNext报告构建进度? - How to report build progress to TFS vNext from within a powershell script? 使用PowerShell在TFS 2015 REST API中构建队列 - Queue Build in TFS 2015 REST API with PowerShell 通过Powershell暂停TFS构建定义 - Pause TFS build definition via powershell 如何在TFS 2015中正确将变量和源版本传递给API 2.0 VNext Build - How to correctly pass variables & source version to API 2.0 VNext Build in TFS 2015 如何使TFS 2015中的PowerShell任务失败 - How to fail the build from a PowerShell task in TFS 2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM