Starting with a template

All building steps start with a template a way of working so every team within the organization will have te same starting point.

This blog is part of a series of blog about “Creating PowerShell modules with Azure Devops.

Within the PowerShell modules building world this is no exceptions. There are multiple tools for accomplish this, but one of my favorite one is Plaster.

Plaster is a template-based file and project generator written in PowerShell. Its purpose is to streamline the creation of PowerShell module projects, Pester tests, DSC configurations, and more. File generation is performed using crafted templates which allow the user to fill in details and choose from options to get their desired output.

Before we can start using Plaster we need to do two things. First, we need to install Plaster.

Install-Module Plaster -Scope CurrentUser

Second thing we need to do is download the PowerShell module template. This can be found here :

EelcoLabordus/PowerShell-Module-Template (github.com)

After downloading the binaries from GitHub you need to run the following command to start working with the Plaster template.

PS C:\> Invoke-Plaster -TemplatePath 'C:\Repos\Public\Plaster_template' -DestinationPath 'C:\Repos\Private'
 ____  _           _
 |  _ \| | __ _ ___| |_ ___ _ __
 | |_) | |/ _` / __| __/ _ \ '__|
 |  __/| | (_| \__ \ ||  __/ |
 |_|   |_|\__,_|___/\__\___|_|
                                            v1.1.3
==================================================
Name of your module: TheAzureCloudNinjaModule
Brief description on this module: This is a test module for The Azure Cloud Ninja
Name for the first public script: Import-TheAzureCloudNinja
Brief description for the first public script: This is a test function for importing plaster stuff
Module authors name: Azure Cloud Ninja
What is the company Name the module is writen for.: 
What is the company Name the module is writen for.: The Azure Cloud Ninja
Project Url location: https://www.theazurecloud.ninja/
Destination path: C:\Repos\Private
      Creating folder structure        
   Create .vscode\
   Create TheAzureCloudNinjaModule\public\
   Create TheAzureCloudNinjaModule\private\
   Create TheAzureCloudNinjaModule\classes\
   Create TheAzureCloudNinjaModule\data\
      Deploying files
   Create .gitignore
   Create azure-pipelines.yml
   Create Module.build.ps1
   Create Module.depend.psd1
   Create .vscode\launch.json
   Create .vscode\settings.json
   Create .vscode\PSScriptAnalyzerSettings.psd1
   Create TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.psm1
   Create TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.psd1
   Create TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.PSSATests.ps1
   Create TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.Tests.ps1
      Updating files
   Create readme.md
   Create LICENSE
   Create docs\about.md
   Create docs\acknowledgements.md
   Create docs\index.md
   Create docs\Quick-Start-Installation-and-Example.md
   Create TheAzureCloudNinjaModule\public\Import-TheAzureCloudNinja.ps1
   Create TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.nuspec
   Update TheAzureCloudNinjaModule\TheAzureCloudNinjaModule.psd1

For more information about Plaster you can visit the site from David Christian. Working with Plaster

Leave a Reply

Your email address will not be published. Required fields are marked *