Open Source DevOps PowerShell Module

There’s a growing need for automation to implement skeleton projects for DevOps deployments and application migrations. It requires a fair amount of finesse and some scripting magic. So for this need, I created the start of a small PowerShell module to help solve that problem.

The Pledge

A colleague a while back contacted me and asked if there was anything in PowerShell that could do certain things in the VSTS stack. After some thought and a couple of hours, I’m proud to present an open source project of a simple set of commands that could be run from PowerShell to perform common VSTS related tasks to help set up your VSTS projects:

List / Create VSTS Projects
List / Create VSTS Service Endpoints
List / Create VSTS Code Repo
List / Create VSTS Work Items
List / Create VSTS Build Definitions
List / Create VSTS Release Definitions
List / Create VSTS Test Manager Cases

The Turn

I chose to use the API calls with Invoke-WebRequest as it would translate easily to Azure Functions at a later time and not knowing whether there is a similar set of PowerShell command lets already out there. This keeps it portable as well as modularized for several delivery methods like:

1. Chocolate
2. Nuget
3. PowerShell Repository via Install-Module
4. The age-old: iex (new-object net.webclient).downloadstring(‘https://your′)

The Prestige

Here is my first pass at that attempt with the creation of the new modules below:

Get-VSTSProjects – Get A List of VSTS Projects You Have Access To
Get-VSTSRepositoryList – Get A List of VSTS Code Repositories You Have Access To
New-VSTSProject – Create a New VSTS Project
New-VSTSServiceEndPoint – Create A New VSTS Service Endpoint
New-VSTSRepoImportRequest – Import Code From External Resource (GitHub, TFS, etc.)

You can find the project source code on my GitHub located here. As always, pull requests are highly encouraged! Let me know if there are additional modules you’d like to see.

Leave a Comment