In my module, I have a number of functions that I wanted to share out to other internal teams. The module stuff is a little more helpful as it’s still relevant. I feel like all the cool kids use GITHUB and GIT Actions but someone else might be stuck using TFS repositories with Azure DevOps 2019 or greater.
These are the functions I have to share. They are various helpers to read, create, or update tickets and builds using the REST API that comes with Azure DevOps.
Here’s the list as I have while writing this-
- Get-ChangesetCountSinceBuild.ps1
- Get-MenuSelection.ps1
- Get-TFSAttachments.ps1
- Get-TFSbuildList.ps1
- Get-TFSbuildStatus.ps1
- Get-TFSqueryDetails.ps1
- Get-TFSrelatedTickets.ps1
- Get-TFSticketDetails.ps1
- New-TFSbuildQueue.ps1
- New-TFSticket.ps1
- New-TFSvariableGroup.ps1
- Update-TFSticket.ps1
There is an odd-ball in the list: Get-MenuSelection is a function to add a menu option with arrow keys to the terminal. I got it from koupi.io but that site was taken down. Glad I grabbed it while I could!
The rest of the functions follow a pretty standard pattern- some parameters to create the connection to ADO (URL, Personal Access Token, and the API version) and perhaps something specific to that function. The connection stuff is assembled and for all the Get- a call is made to ADO for some information. If in a New- function, the details are added to a $body variable and then the connection pushes the new whatever to ADO. If the connection has worked then the requested or new object is returned.
You can hit me up with questions in GITHUB.