This is a Proof of Concept repo to show how you can build CI/CD pipeline for a PowerShell module.
The example is an old PowerShell module I started for VMware vCloud Director.
Dev | Test | Prod |
---|---|---|
I've created various scripts for vCloud Director over the past few years, so I plan to use this module as an opportunity to refactor and share these scripts one by one. I'll apply the latest methods and best practices I've learnt recently, with a focus on the process around The Release Pipeline Model (Source > Build > Test > Release).
Use Git with the practical common flow branching model.
Use psake to develop build scripts that can be used both locally using Task Runners in Visual Studio Code, and by a CI/CD system like Azure DevOps.
This will cover:
- Compiling separate function files into a single .psm1 module.
- Automatically updating documentation in Markdown, ready for a 3rd-party like ReadTheDocs.
Test the compiled code for known issues and ensure it aligns to defined standards.
This will cover:
- Code analysis using
PSScriptAnalyzer
. - Code testing (unit, and common) using
Pester
.
Publish the module build artifact to an Azure DevOps Artifacts (NuGet) feed.