Author Posts

October 1, 2017 at 2:53 pm

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 !

October 1, 2017 at 2:54 pm

Have you looked at Plaster at all?

October 1, 2017 at 2:56 pm

Hi Don!
Nope, will have a look.
Thanks

October 1, 2017 at 2:58 pm

https://github.com/PowerShell/Plaster

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.

October 1, 2017 at 2:58 pm

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

October 1, 2017 at 3:11 pm

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 😉

October 1, 2017 at 3:15 pm

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.