自定义构建任务未删除 [英] Custom build task is not deleted

查看:71
本文介绍了自定义构建任务未删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 tfx-cli 删除构建任务。

I'm trying to delete a Build Task using tfx-cli.

C:\Users\Work>tfx build tasks list
TFS Cross Platform Command Line Interface v0.4.11
Copyright Microsoft Corporation

id            : 122d5ad0-61a1-11e6-b9c1-5b12bd371fa9
name          : VersionAssembly
friendly name : Version Assembly
visibility    : Build
description   : Update the assembly version number to match the build number
version       : 1.0.9

我现在有了任务ID。

C:\Users\Work>tfx build tasks delete --task-id 122d5ad0-61a1-11e6-b9c1-5b12bd371fa9
TFS Cross Platform Command Line Interface v0.4.11
Copyright Microsoft Corporation

Task 122d5ad0-61a1-11e6-b9c1-5b12bd371fa9 deleted successfully!

但是即使在 Ctrl + F5 刷新后,任务仍然显示在TFS中:

But even after a Ctrl+F5 Refresh, the task still shows up in TFS:

再次运行 delete 命令会显示相同的内容。成功。不是找不到或类似的东西。

Running the delete command again shows the same thing. Success. Not "Can't be found," or some such thing.

如何摆脱这种讨厌的臭虫?

How to get rid of this pesky bugger?

推荐答案

我能够通过REST API删除任务:

I was able to delete the Task via the REST API:

$Credential = Get-Credential
$Headers = @{ "Accept" = "application/json; api-version=2.0"; "X-TFS-FedAuthRedirect" = "Suppress" }
$Uri = "http://hostname:8080/tfs/_apis/distributedtask/tasks/122d5ad0-61a1-11e6-b9c1-5b12bd371fa9"

Invoke-RestMethod -Credential $Credential -Headers $Headers -Uri $Uri -Method Delete

根据杰西·霍温(Jesse Houwing)的建议,我的理论是,因为它首先是使用API​​创建的(我在上面的评论中不正确),所以也必须使用API​​删除它。

Following on Jesse Houwing's suggestion, my theory is that because it was created with the API in the first place (my recollection in my comment above is incorrect), it also had to be deleted with the API.

这篇关于自定义构建任务未删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆