Extending the new Build and Release features of Visual Studio Team Services (and TFS) helps you turn your scripts into easily re-usable build steps. There are a number of options, from simple scripts to complete custom tasks built using C#, PowerShell or Typescript. We’ll walk through the options and will pros and cons each and quickly walk through the process of building and releasing a custom task to the Visual Studio Marketplace.
14. PowerShell TypeScript
Supported on Windows Supported on Windows, Linux and Mac
Can call into existing PowerShell modules Can call PowerShell.exe for similar functionality
Can call into existing .NET APIs Can call PowerShell.exe for similar functionality
Only supported on Windows Single implementation for all platforms
Dynamic typing Static typing with compiler and linter
Uses TFS Client Object Model to talk to TFS / VSTS REST
and SOAP endpoints
Uses TypeScript SDK to task to TFS / VSTS REST
endpoints
Yes you can code a task directly in JavaScript, but why would you?!
16. An Extension manifest
Extension ID and Publisher
A Task manifest
Task ID and Task Name
Inputs & Execution
Implementation(s)
Powershell or TypeScript/Javascript
Dependencies
Task SDK
Tools & other assemblies
23. Arrange
• Import the SDK
• Set Environment variable
Act
• Execute your task
Assert
• Inspect the expected results
Out-of-the-box mocks are
on their way!
https://www.flickr.com/photos/calliope/3134840025/
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
Looks a lot like C#
ES6 makes it look even more like C#
Compiler checks for obvious mistakes
Fewer surprises than PowerShell
Makes my task Cross Platform
But it takes a bit to really get used to.