Powershell template system

Hi all, hope this is OK to ask feedback on this forum, if not feel free to delete this post.
I’m trying to buid a templating system for powershell scripts, aiming to ease the reuse of existing functions without copy/paste code extracts.
The project is on github https://github.com/kayasax/PowershellTemplate I would be happy if anyone willing to test and send feedback.

Happy scripting !

Have you looked at Plaster at all?

Hi Don!
Nope, will have a look.


And, as a note, I personally tend to avoid either copying and pasting functions or even including them in templates. For me, centralizing those in a module - which I can run through a build pipeline and distribute via a private repo - centralizes the code. If you’ve got 80 copies of a function roaming around in the world, making fixes becomes a huge PITA.

But Plaster is the templating system (and a bit more) that the product team uses. Rather than rolling your own, it might be worth learning more about that and seeing if it fits the bill. If you look up the PowerShell Unplugged session Snover and I just did at Ignite, Joey Aiello did a Plaster demo.

There are a couple of templating systems of which I’m aware:

Plaster - https://github.com/PowerShell/Plaster

PSScaffold - https://github.com/RedeployAB/PSScaffold

Maybe worth seeing what they are doing


Thank you both for your responses, plaster seems a bit too much for what I’m trying to achieve though. Anyway sure I will learn somethings looking at these repos :wink:

Don, yes that’s also my point of view. Maybe template is not the correct word for what I’m trying to do, a “mini framework” may be more appropiate.