1

I am working on a build to run a powershell script on a remote machine, using the VSTS task : Powershell on Target Machines

I currently am using TFS2017 on premise, and this is version 1 of that task. There is a version 3 available on github here : 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! Well, there is, but it requests that you provide a .VISX file. Which the repo in GIT does not have.

I've tried running the steps in this other post: How to update the built-in Microsoft task library in TFS 2017? But running the command "npm run package -- --version " doesn't generate the 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? I'm very confused.

Any help is appreciated!

evolmonster
  • 237
  • 1
  • 5
  • 16
  • Version 3 comes with TFS 2019 OOB. So like Patrick mentions bellow if you want it in 2017 you have to package and deploy it yourself. Problem is I'm not sure you can upgrade it. It's not showing in the installed tasks (because it's built in) so you won't be able to just upgrade. Maybe from the tfx command line but now you're upgrading internal MS tasks and I'm not sure how that will play when you try to upgrade to 2018 or 2019 later. What is your bug maybe there is a way around trying to upgrade. – Etienne Feb 20 '20 at 13:36
  • Thanks @PatrickLu-MSFT - I am trying to work out how to do this now. But since it is updated in TFS2019, and I am planning on an upgrade to that soon, I may just wait for the upgrade. – evolmonster Mar 03 '20 at 19:47

1 Answers1

1

Since you are working on TFS on-premise, the task version will not auto update. You need to manually install "PowerShell on Target Machines" task version 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)

    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 i -g tfx-cli

  • Package your extension in a .vsix file

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

More details please refer this official tutorial: Package, publish extensions.

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62