Powershell template system

Welcome Forums General PowerShell Q&A Powershell template system

This topic contains 7 replies, has 3 voices, and was last updated by

 
Participant
1 year, 1 month ago.

  • Author
    Posts
  • #81013

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,625
    Helping HandTeam Member
    Rank: Community Hero

    Have you looked at Plaster at all?

    • #81017

      Participant
      Points: 0
      Rank: Member

      Hi Don!
      Nope, will have a look.
      Thanks

    • #81025

      Participant
      Points: 0
      Rank: Member

      removed

  • #81019

    Keymaster
    Points: 1,625
    Helping HandTeam Member
    Rank: Community Hero

    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

      Participant
      Points: 0
      Rank: Member

      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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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 😉

The topic ‘Powershell template system’ is closed to new replies.