This is a useful collection of Plaster templates. In other words a plethora of Plaster templates. For your convenience and ease of use.
I started this project as I was in need of a good way to share Plaster templates. Looking at the issue discussion in the Plaster project (e.g. PowerShellOrg/Plaster#224 or PowerShellOrg/Plaster#213 and there are more) I also thought that this is a general need of the PowerShell community. So here we are.
Plaster Plaster is a scaffolding engine. Like yeoman is for WebApps. It helps you define, via a manifest file, the structure, included tools and so forth. For a module to be generated with Plaster. This makes it easy to scaffold e.g. a new PowerShell module. E.g. to avoid forgetting to include logging.
Your brain capacity is hereby freed to think about the real challenge at hand, instead of navigating the standard details of creating 'x' coding project.
Hopes I hope to kickstart a way to share Plaster templates. Doing it here on GitHub might certainly not be the perfect way. But, it's a start none the less. I hope, as time goes by. More people will join the project. Add templates.
Together can find a good way of sharing Plaster templates.
- Plaster has to be installed
- If you haven't, it can be done by executing
Install-Module -Name Plaster(which will download the module from the PSGallery & install it)
- If you haven't, it can be done by executing
- Download the latest Plaster Plethora release from releases or
git cloneit- If you downloaded it, extract the release to a folder of your liking
Please see the template list wiki page for an overview and details on the included templates
- Look at the code of the template that you wish to use. In order to feel safe about the code. This is always a good idea! (
Get-PlasterTemplatecan be used to inspect a template) - To use a specific template: Use the
Invoke-Plastercmdlet by pointing it to thecontentfolder of the template you wish to use. This will execute Plaster on the template manifest inside thecontentfolder and generate a project based on the input you give to the template. Here is an example:Invoke-Plaster -TemplatePath .\PS-AdvModule+InvokeBuild+Log4Net+Pester\content -DestinationPath ..\testing
- If you have content, that you want included in the template. Start by either creating a folder in the root of the PlasterPlethora folder and put your content here or you can alternatively use the
-ContentPathparameter to theCreatePlasterTemplatescript. In order to specify an alternative folder where you have stored your content - Then execute:
./CreatePlasterTemplate.ps1
The naming of a template follows this "convention" > [LANGUAGE-ProjectType+Tooling]. To which there is three parts.
- LANGUAGE = the main programming language which the generated project will be based on.
-= a delimiter. Delimiting theLANGUAGEpart and theProjectTypepart.- ProjectType = The type of project represented by the template. E.g. if the project is an
advanced PowerShell projectthe type could be = AdvModule AKA an advanced module. += a delimiter. Delimiting theProjectTypepart and theToolingparts of the naming convention.- Tooling = a
+character delimited list of tools being used in the template. E.g.PS-AdvModule+Pesteris a template generating a advanced PowerShell module which utilizes Pester.
Suggested folder structure
"TEMPLATE_NAME" > The root folder
└───"SUB_FOLDER"
└───"SUB_SUB_FOLDER"
└───"SUB_FOLDER"
|───PlasterManifest.xml > the Plaster template manifest file. This is the file in which you define the specifics of the entity to be scaffolded.Here is a good example of what could be the structure of a Plaster template.
PS-AdvModule+Pester > The root folder
└───Docs
└───en-US
├───OverOfMyApp.md
└───Editor
└───VSCode
├───extensions
└───snippets
└───InvokeBuild
└───Logging
└───Tests
└───PSScriptAnalyzer
|───PlasterManifest.xml