This Repo contains a really simple azure devops extension with just one build task. This build task uses the new PowerShell3 Task Executer. You can use this structure as template to create your own azure devops extension. This custom build task showcased here is only intended to be run on a windows machine.
Have a look at microsofts tutorial of how to create a custom build task. There they list everything needed to create and publish a custom build task.
- Update the information inside of the vss-extension.json
- Update the information inside of the task.json
- Potentially look for an updated version of the VstsTaskSdk (current: 0.11.0)
- Replace the content inside of the VstsTaskSdk-Folder with the new content
- Send me a pr to update this repo 😅
- Remove the MinApp-Folder
- Update the task.ps1 script for your purpose
- Replace the icons here for the extension and here. Both need to be 128x128.
You can use the pack_and_publish.ps1 script to automate the publishing of your newly created extension. You can also pass in an organisation to share your extension with. It will be published privately by default.
After I fixed the ps_module folder structure (removing the 0.11.0 and moving its contents directly into its parent folder) the build task works. Also the task.ps1 shows you how to run another app using start-process cmdlet and using the correct options to retrieve its ExitCode.