简体   繁体   English

将 TFS2017 任务更新到最新版本

[英]Update TFS2017 task to latest version

I am working on a build to run a powershell script on a remote machine, using the VSTS task :我正在构建以使用 VSTS 任务在远程计算机上运行 powershell 脚本: 目标机器上的 Powershell

I currently am using TFS2017 on premise, and this is version 1 of that task.我目前在内部使用 TFS2017,这是该任务的第 1 版。 There is a version 3 available on github here : https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/PowerShellOnTargetMachinesV3 github 上有一个版本 3: https : //github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/PowerShellOnTargetMachinesV3

I am having an issue with this task failing, and I have read elsewhere that this version has a fix for my issue, so I want to update it if possible.我遇到了这个任务失败的问题,我在别处读到这个版本有一个修复我的问题,所以如果可能的话我想更新它。 I tried a few ways to do this, but I cannot work out what I am supposed to be doing.我尝试了几种方法来做到这一点,但我无法弄清楚我应该做什么。 You would think there would be an update button in TFS!你会认为 TFS 中会有一个更新按钮! Well, there is, but it requests that you provide a .VISX file.嗯,有,但它要求您提供 .VISX 文件。 Which the repo in GIT does not have. GIT 中的 repo 没有。

I've tried running the steps in this other post: How to update the built-in Microsoft task library in TFS 2017?我已尝试运行另一篇文章中的步骤: 如何更新 TFS 2017 中的内置 Microsoft 任务库? But running the command "npm run package -- --version " doesn't generate the VISX.但是运行命令“npm run package -- --version”不会生成 VISX。

I tried running :我试过运行:

npm run package --PowerShellOnTargetMachinesV3 --version 3.1.3

That responds with the output:响应输出:

5.6.0

Which I am not sure what to do with!我不知道该怎么办!

I have seen another post that says I need to use the tfs-cli?我看到另一篇文章说我需要使用 tfs-cli? I'm very confused.我很困惑。

Any help is appreciated!任何帮助表示赞赏!

Since you are working on TFS on-premise, the task version will not auto update.由于您在内部使用 TFS,因此任务版本不会自动更新。 You need to manually install "PowerShell on Target Machines" task version 3.0您需要手动安装“PowerShell on Target Machines”任务版本 3.0

You just need to download the source code and package it as an extension, finally upload and install your extension.您只需要下载源代码并将其打包为扩展程序,最后上传并安装您的扩展程序。 There are some steps updated:更新了一些步骤:

  • Get the package tool (tfx-cli)获取打包工具 (tfx-cli)

    You can install or update the TFS Cross Platform Command Line Interface (tfx-cli) using npm, a component of Node.js, from your command line.您可以从命令行使用 npm(Node.js 的一个组件)安装或更新 TFS 跨平台命令行界面 (tfx-cli)。

    npm i -g tfx-cli

  • Package your extension in a .vsix file将您的扩展程序打包到 .vsix 文件中

    tfx extension create --manifest-globs vss-extension.json

More details please refer this official tutorial: Package, publish extensions .更多细节请参考这个官方教程: 打包,发布扩展

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM