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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Connect-AzDo
Disconnect-AzDo
Get-AzDoGitRepository
Get-AzDoProcesses
Get-AzDoProject
Get-AzDoProjectHistory
Get-AzDoProjectProperties
Get-AzDoSecurityNamespace
Get-AzDoTeam
New-AzDoGitRepository
New-AzDoProject
New-AzDoTeam
Remove-AzDoGitRepository
Remove-AzDoProject
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
2
3
4
$token = "token"
$organizationName = "orgName"

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
2
3
Get-AzDoProject
Get-AzDoTeam -ProjectId '<projectId>'
New-AzDoProject -Name 'ProjectOne'