Skip to content

wekempf/pshape

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

PShape

A modern PowerShell templating and scaffolding engine!
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

PowerShell has a great templating engine already in Plaster, but I've found it difficult to work with. Scaffolding with Invoke-Plaster is difficult, requiring you to specify the full path to the template you want to use. Authoring templates is complicated with a complex XML manifest file and a template syntax that is while very powerful, also not the friendliest to write. Packaging and sharing templates is an after thought at best. I believe that all of these traits lead to Plaster not being used as much as a templating engine should be.

PShape is a modern PowerShell templating and scaffolding engine designed to address all of these issues. When scaffolding you use a template's name, rather than having to specify a path. Authoring is greatly simplified with a slim manifest file, authored in JSON, with useful default behavior. The template files are authored using Moustache a very simple "logic-less" templating syntax. Packaging templates is as simple as creating a PowerShell module (a PShape template exists for that!) with a PShapes directory and sharing is as easy as publishing that module to the PowerShell Gallery. My hope is that all of this means there will be plenty of templates contributed by the community, but PShape comes with a core set of templates out of the box.

(back to top)

Built With

The following build tools are used in the creation of PShape, but they are all (with the obvious exception of PowerShell Core 7) bootstrapped by the build.ps1 script.

Note: As a modern PowerShell templating engine there's currently a requirement for PowerShell Core 7. If you need to use PShape on an older PowerShell version I'm taking pull requests. :)

(back to top)

Getting Started

PShape is very friendly to use and is distributed as a PowerShell module in the PowerShell Gallery.

Installation

To use PShape the first thing you'll need to do is install the module.

PS> Install-Module PShape -Scope CurrentUser

(back to top)

Usage

If you haven't already done so, you should import the PShape module (consider adding this to your profile).

PS> Import-Module PShape

With PShape imported you can get a list of the known templates (at this point it's likely only the default templates that come with the PShape module).

PS> Get-PShapeTemplate

You can generate files from a template by simply specifying the template name.

PS> New-PShape -Name script -InputObject @{ name = 'myscript' }

You can read a lot more information about using PShape by reading about_PShape.

PS> Get-Help about_PShape

(back to top)

Roadmap

  • Publish 1.0 package to the PowerShell Gallery

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Another great way to contribute is to simply create PShape templates and publish them to the PowerShell Gallery. See about_PShape for more information on how this is done.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

William E. Kempf - @wekempf - [email protected]

Project Link: https://github.com/wekempf/pshape

(back to top)

Acknowledgments

The following projects were used by or inspired this project.

(back to top)

About

A modern PowerShell templating engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published