Azure DevOps CI/CD Pipeline, PowerShell & PSScriptAnalyzer

In my last blog post, I introduced you to the solution I’m using on Office 365 to create personal e-mail addresses. This solution is hosted on Azure DevOps and is automatically released to the PowerShell Gallery. In this blog post, I will explain briefly how this works.

The Azure DevOps project is hosted in a public repository. This was introduced recently and enables other users of the module to contribute to the project. I started with an empty repository and created a new branch to upload the PowerShell module & manifest file to the repository.

Build

Who doesn’t like a neat PowerShell script? I do! So I always want to make sure that my scripts comply with the rules defined in the PSScriptAnalyzer code checker. The module must pass these rules before it gets uploaded to the PowerShell Gallery. I was able to do this by using an Azure DevOps Build Pipeline. The link redirects you to a successful build that shows you how this works. (Also notice how it grabs the Build ID and uses it as a release version of the module in the PowerShell Gallery!)

Release

After a successful build, it’s time for the release to production! (OK, I might soon add a step or two before releasing to production. 😂)

The release grabs the build artifact which contains the module and the manifest, and uploads it to the PowerShell Gallery.

The result

A fully operational CI/CD pipeline that automatically builds, checks the code and releases it to the PowerShell Gallery! Great stuff! ✌

4 thoughts on “Azure DevOps CI/CD Pipeline, PowerShell & PSScriptAnalyzer

  1. Hi Jean-Paul,
    Could you share your build pipeline ? I can only see the history and result of the build..
    could you share the Yaml file or provide read only access to your pipeline ? Thanks

    Like

  2. Hello, Would you be able to do a write up on how you set up the pipeline. I am looking to do this same thing and seeing how you did this would be very helpful.

    Thanks

    Like

Leave a Reply to Jean-Paul van Ravensberg Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s