If you are like me - at least in terms of lazyness - you automate the stuff that you face more than once. Recently, I came accross the reoccuring task of creating Azure DevOps projects with several teams over and over again.

This is the first post of many other posts to come and I would really appreciate some feedback!

Since I’m a PowerShell guy, I started writing a little Module for this and the first version is now online!

You can get it directly from the PowerShell Gallery:

Install

1
Install-Module -Name AzDOps

The new Azure PowerShell module uses the prefix ‘Az’ (Microsoft Docs link) for the cmdlets - the cmdlets for Azure DevOps use ‘AzDo’.

1
Connect-AzDo
2
Disconnect-AzDo
3
Get-AzDoGitRepository
4
Get-AzDoProcesses
5
Get-AzDoProject
6
Get-AzDoProjectHistory
7
Get-AzDoProjectProperties
8
Get-AzDoSecurityNamespace
9
Get-AzDoTeam
10
New-AzDoGitRepository
11
New-AzDoProject
12
New-AzDoTeam
13
Remove-AzDoGitRepository
14
Remove-AzDoProject
15
Remove-AzDoTeam

Disclaimer:
The module does by far not have the final scope yet. It currently only covers very basic functionality but it will grow over the months to come.

Connect

To connect to your Azure DevOps organization, you have to create a personal access token first. Open this link and follow the instructions. Afterwards, you can save both, the token as well as the name of your Azure DevOps organization as a string to a variable - then you can connect:

1
$token = "token"
2
$organizationName = "orgName"
3
4
Connect-AzDo -PersonalAccessTokens $token -OrganizationName $organizationName

In the future, there will also be an interactive way to connect using Oauth2 - it’s planned for the next releases.
Right now, the connection is being established using basic authentication.

When you’re connected, you can start using the cmdlets:

1
Get-AzDoProject
2
Get-AzDoTeam -ProjectId '<projectId>'
3
New-AzDoProject -Name 'ProjectOne'