CI/CD

Caching PowerShell modules in Azure Pipelines

Intro This is a short post to demonstrate how you can use a cache in Azure DevOps (Azure Pipelines) to store any PowerShell module that you need during your pipeline. Don’t let your pipeline rely on the availability PowerShell Gallery! This goes for anything really, but in this post I’m focusing on the PowerShell Gallery. There are two simple reasons for this statement: Downloading modules from the gallery takes time, not something I want to do every time I run my pipeline.

Continuously deploying my PowerShell Modules

Continuously building and deploying new versions of my modules to internal repositories (or PowerShell Gallery) is something I really like. That way I can just push my code and let the automation handle the rest. Here are some learnings I’ve made. Deploy on tag Firstly, I usually only trigger a deploy-workflow on tags, this way I can manually decide when to do a release and what version it will have without relying on any complex methods.