My company has a on-premise TFS 2017 instance. I know how to install and update extensions through the web interface, but it's pretty tedious. I'm wondering if there's a quicker way to do it with tfs-cli
.
Took me awhile to figure this out for some reason. At first I thought tfs-cli
could only be used to publish extensions to the Visual Studio Marketplace, but that's not the case. Here's how to do it for on-prem TFS:
You can follow the instructions here. Or:
Enter the following in the commandline:
tfx login
You'll be prompted to enter the service URL and the personal access token you generated in the last step.
For the service URL, use whatever your company uses to access TFS. Example URLs:
Some things to watch out for:
/tfs/
in the URL. For example, it's possible to get rid of the /tfs/
virtual directory when installing. Look at the URL you use when you use TFS in your browser and your command accordingly.tfx extension create --manifests <manifest-file-name> --rev-version
--manifests
flag is used for specifying the filename of your manifest, e.g. vss-extension.json
--rev-version
flag will automatically increment the patch number of your package.Use the publish
command to install/update (it'll figure out which needs to be done) your extension.
tfx extension publish --service-url <tfs-url>
You need to specify the service URL again here. If you don't, tfx
will attempt to publish your extension to the VSS marketplace.
Lastly, my preferred script:
rm *.vsix && # Remove old packages
tfx extension create --manifests <manifest-file-name> --rev-version &&
tfx extension publish --service-url <tfs-url>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With