Creating a new project template
Describes the ins and outs of how to create a project template.
This article assumes you have read and understood the post on creating a new file template.
What is a project?
A project in the context of PSModuleDevelopment Templates is the content of a folder and all its children.
There is no ‘quality’ needed to become a project - all folders qualify, no exceptions.
New-PSMDTemplate with the
-ReferencePath parameter pointed at a folder, it will automatically scan all folders and files in it and turn them all into one template bundle.
For this it parses the parameters from all files and assembles one master list, removing duplicates.
New-PSMDTemplate -ReferencePath F:\temp\MyModule -TemplateName MyModule -Description "Contains my module"
What becomes part of my template?
All contents in the targeted reference folder are content, but not the folder itself.
- It is possible to apply a filter by using the
-Filterparameter (Which is passed through to
Get-ChildItemwhen scanning the folder).
- It is possible to explicitly specify a list of excluded files by their relative path to the reference path.
Is there any way to simplify this further for templates I keep updating?
That sure is possible.
Using a Project Reference File you can predefine all of the meta information and other helpful functionalities.
Don’t worry, the guide should cover it all as needed and it’s fairly simple to use.