powershell.sample-module
powershell.sample-module copied to clipboard
Sample CI/CD pipeline for PowerShell module
powershell.sample-module
A sample CI/CD pipeline for a PowerShell module.
Before starting to work with this sample project, I suggest reading the information in the following blog posts:
Build Status
Introduction
This repository contains the source code for a sample PowerShell module along with Azure DevOps pipeline configuration to perform all build, test and publish tasks.
Getting Started
Clone the repository to your local machine and look for project artifacts in the following locations:
- SampleModule - source code for the module itself along with tests
- SampleModule.build.ps1 - build script for the module
- SampleModule.depend.psd1 - managing module dependencies with PSDepend
- build - this folder will be created during the build process and will contain the build artifacts
Build and Test
This project uses InvokeBuild module to automate build tasks such as running test, performing static code analysis, building the module, etc.
- To build the module, run: Invoke-Build
- To see other build options: Invoke-Build ?
Suggested tools
- Editing - Visual Studio Code
- Runtime - PowerShell Core
- Build tool - InvokeBuild
- Dependency management - PSDepend
- Testing - Pester
- Code coverage - Pester
- Static code analysis - PSScriptAnalyzer