https://github.com/powershelllibrary/plastertemplate-psmodule
Plaster template for a PowerShell module.
https://github.com/powershelllibrary/plastertemplate-psmodule
plaster plaster-template powershell
Last synced: 10 months ago
JSON representation
Plaster template for a PowerShell module.
- Host: GitHub
- URL: https://github.com/powershelllibrary/plastertemplate-psmodule
- Owner: PowerShellLibrary
- Created: 2019-03-19T22:51:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-27T17:39:32.000Z (12 months ago)
- Last Synced: 2025-01-27T18:42:39.207Z (12 months ago)
- Topics: plaster, plaster-template, powershell
- Language: PowerShell
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlasterTemplate-PSModule
This is a Plaster template for a PowerShell module.
## How to use
### Install Plaster
Module is available on [Powershell Gallery][gallery]
``` powerShell
Install-Module -Name Plaster
```
### Import Plaster
```powershell
Import-Module Plaster
```
## Clone the template
``` powerShell
git clone https://github.com/PowerShellLibrary/PlasterTemplate-PSModule
```
## Creating a new module
There are two methods of creating a new module.
* Create a hash table containing the required parameters and invoke ```Invoke-Plaster```
``` powerShell
$parameters = @{
DestinationPath = "C:\repo\PS.Modules"
TemplatePath = "C:\repo\PlasterTemplate-PSModule"
Author = 'Alan'
ModuleVersion = '1.0.0'
ModuleName = '_ModuleName_'
ModuleDescription = '_Description_'
}
Invoke-Plaster @parameters
```
output:
```
____ _ _
| _ \| | __ _ ___| |_ ___ _ __
| |_) | |/ _` / __| __/ _ \ '__|
| __/| | (_| \__ \ || __/ |
|_| |_|\__,_|___/\__\___|_|
v1.1.3
==================================================
Destination path: C:\repo\PS.Modules
Creating test folder and files
Create _ModuleName_\
Create _ModuleName_\Public\
Create _ModuleName_\Private\
Create _ModuleName_\_ModuleName_.psd1
Create _ModuleName_\_ModuleName_.psm1
```
* Call ```Invoke-Plaster``` and fill parameters manually (template)
``` powerShell
Invoke-Plaster -DestinationPath "C:\repo\PS.Modules" -TemplatePath "C:\repo\PlasterTemplate-PSModule"
```
output:
```cmd
____ _ _
| _ \| | __ _ ___| |_ ___ _ __
| |_) | |/ _` / __| __/ _ \ '__|
| __/| | (_| \__ \ || __/ |
|_| |_|\__,_|___/\__\___|_|
v1.1.3
==================================================
Module author's name (Alan Płócieniak):
Module name: _ModuleName_
Module version (1.0.0):
Module description: _Description_
Destination path: C:\repo\PS.Modules
Creating test folder and files
Create _ModuleName_\
Create _ModuleName_\Public\
Create _ModuleName_\Private\
Create _ModuleName_\_ModuleName_.psd1
Create _ModuleName_\_ModuleName_.psm1
```
## Plaster Manifest
Other settings available [here](https://github.com/PowerShellOrg/Plaster/blob/master/docs/en-US/about_Plaster_CreatingAManifest.help.md)
Extended template example:
```xml
StandardModuleTemplate
a9c355a8-0228-4f58-8df9-3291dd997c1e
1.0.0
Standard Module Template
Chuck Norris
Creating test folder and files
Creating VSCode folder and files
Creating code folders
Creating GitHub folder and files
Creating license file
Deploying root directory files
Creating module manifest
```
[gallery]: https://powershellgallery.com/packages/Plaster/