Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wekempf/pshape
A modern PowerShell templating engine
https://github.com/wekempf/pshape
Last synced: 9 days ago
JSON representation
A modern PowerShell templating engine
- Host: GitHub
- URL: https://github.com/wekempf/pshape
- Owner: wekempf
- License: mit
- Created: 2021-11-21T16:09:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-06T23:10:20.000Z (about 3 years ago)
- Last Synced: 2024-08-13T07:05:07.654Z (4 months ago)
- Language: PowerShell
- Size: 658 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - wekempf/pshape - A modern PowerShell templating engine (PowerShell)
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
Table of Contents
## About The Project
[![Product Name Screen Shot][product-screenshot]](https://example.com)
PowerShell has a great templating engine already in [Plaster](https://www.powershellgallery.com/packages/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](https://mustache.github.io/mustache.5.html) 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](https://www.powershellgallery.com/). 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.
### 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. :)
* [PowerShell Core 7](https://github.com/powershell/powershell)
* [InvokeBuild](https://github.com/nightroman/Invoke-Build)
* [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer)
* [Pester](https://pester.dev/)
* [GitVersion](https://gitversion.net/)
* [PlatyPS](https://github.com/PowerShell/platyPS)## Getting Started
`PShape` is very friendly to use and is distributed as a PowerShell module in the [PowerShell Gallery](https://www.powershellgallery.com/).
### Installation
To use `PShape` the first thing you'll need to do is install the module.
```PowerShell
PS> Install-Module PShape -Scope CurrentUser
```## Usage
If you haven't already done so, you should import the `PShape` module (consider adding this to your profile).
```PowerShell
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).
```PowerShell
PS> Get-PShapeTemplate
```You can generate files from a template by simply specifying the template name.
```PowerShell
PS> New-PShape -Name script -InputObject @{ name = 'myscript' }
```You can read a lot more information about using `PShape` by reading `about_PShape`.
```PowerShell
PS> Get-Help about_PShape
```## Roadmap
- [ ] Publish 1.0 package to the PowerShell Gallery
See the [open issues](https://github.com/wekempf/pshape/issues) for a full list of proposed features (and known issues).
## 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 RequestAnother great way to contribute is to simply create `PShape` templates and publish them to the [PowerShell Gallery](https://www.powershellgallery.com/). See `about_PShape` for more information on how this is done.
## License
Distributed under the MIT License. See [LICENSE](https://raw.githubusercontent.com/wekempf/pshape/main/LICENSE) for more information.
## Contact
William E. Kempf - [@wekempf](https://twitter.com/wekempf) - [email protected]
Project Link: [https://github.com/wekempf/pshape](https://github.com/wekempf/pshape)
## Acknowledgments
The following projects were used by or inspired this project.
* [Plaster](https://github.com/PowerShellOrg/Plaster)
* [Poshstache](https://github.com/baldator/Poshstache)
* [Moustache](https://mustache.github.io/mustache.5.html)
* [InvokeBuild](https://github.com/nightroman/Invoke-Build)
* [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer)
* [Pester](https://pester.dev/)
* [GitVersion](https://gitversion.net/)
* [PlatyPS](https://github.com/PowerShell/platyPS)
* [Best-README-Template](https://github.com/othneildrew/Best-README-Template)[contributors-shield]: https://img.shields.io/github/contributors/wekempf/pshape?style=for-the-badge
[contributors-url]: https://github.com/wekempf/pshape/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/wekempf/pshape?style=for-the-badge
[forks-url]: https://github.com/wekempf/pshape/network/members
[stars-shield]: https://img.shields.io/github/stars/wekempf/pshape.svg?style=for-the-badge
[stars-url]: https://github.com/wekempf/pshape/stargazers
[issues-shield]: https://img.shields.io/github/issues/wekempf/pshape.svg?style=for-the-badge
[issues-url]: https://github.com/wekempf/pshape/issues
[license-shield]: https://img.shields.io/github/license/wekempf/pshape.svg?style=for-the-badge
[license-url]: https://github.com/wekempf/pshape/blob/master/LICENSE
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/wekempf
[product-screenshot]: images/screenshot.png