Scaffolds a new PowerShell module project intended for CI/CD workflow using Azure Pipelines.
Note: Before getting started you should have a basic idea of what you expect your module to support. If your module is cross-platform, or you want to test different versions of PowerShell you should run multiple build types.
Windows PowerShell | Windows pwsh | Linux | MacOS |
---|
-
You will need an Azure DevOps Organization.
-
Create a new Project:
-
Create a new pipeline and choose where your code will come from:
-
Create your project using Catesta
New-PowerShellProject -CICDChoice 'Azure' -DestinationPath C:\path\AzurePipeline
- The Plaster logo will be displayed and you will see your first prompt
- Enter the name of the module: Name of your module
- Enter a description for the module: Description of what your module does
- Enter the version number of the module (0.0.1): Starting version #
- Enter your full name: Module author name
- Would you like to generate a Changelog file?
- Select a License for your module. (Help deciding: https://choosealicense.com/)
- Would you like to generate a Code of Conduct file?
- Would you like to generate a Contributing guidelines file?
- Would you like to specify a coding style for the project? [S] Stroustrup [O] OTBS [A] Allman [N] None [?] Help (default is "S"): The preferred coding style for the project
- Would you like to use platyPS to generate help documentation files for your project? Creates Markdown & external help for your module
- Select desired pipeline job configurations. (If your module is cross-platform you should select multiple)
- [W] Windows - PowerShell
- [C] Core (Windows)- pwsh
- [L] Linux
- [M] MacOS
-
Write a kick-ass module (the hardest part)
- All build testing can be done locally by navigating to src and running
Invoke-Build
- If using VSCode as your primary editor you can use tasks to perform various local actions
- Examples:
Press Ctrl+P, then type 'task .'
- Runs complete build (all tasks)Press Ctrl+P, then type 'task Test'
- Invokes all Pester Unit TestsPress Ctrl+P, then type 'task Analyze'
- Invokes Script Analyzer checksPress Ctrl+P, then type 'task DevCC'
- Generates generate xml file to graphically display code coverage in VSCode using Coverage Gutters
- Examples:
- All build testing can be done locally by navigating to src and running
-
The comment based help in your functions will be used to generate/update markdown docs for your module in the docs folder.
-
Upload to your desired repository which now has a triggered/monitored build action.
-
Evaluate results of your build and display your Azure Pipelines badge proudly!
Additional Reading: