Powershell template system

This topic contains 7 replies, has 3 voices, and was last updated by  Loïc MICHEL 2 weeks, 3 days ago.

  • Author
    Posts
  • #81013

    Loïc MICHEL
    Participant

    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 !

  • #81014

    Don Jones
    Keymaster

    Have you looked at Plaster at all?

  • #81019

    Don Jones
    Keymaster

    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.

    • #81037

      Loïc MICHEL
      Participant

      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.

  • #81022

    Richard Siddaway
    Moderator

    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

  • #81026

    Loïc MICHEL
    Participant

    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 😉

You must be logged in to reply to this topic.