Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbroeglin/Forge.Module
Forge generator for PowerShell modules
https://github.com/dbroeglin/Forge.Module
forge forge-generators git module pester powershell scaffolding visual-studio-code
Last synced: 3 months ago
JSON representation
Forge generator for PowerShell modules
- Host: GitHub
- URL: https://github.com/dbroeglin/Forge.Module
- Owner: dbroeglin
- License: apache-2.0
- Created: 2016-10-03T20:24:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T20:53:31.000Z (almost 7 years ago)
- Last Synced: 2024-05-28T02:20:39.777Z (5 months ago)
- Topics: forge, forge-generators, git, module, pester, powershell, scaffolding, visual-studio-code
- Language: PowerShell
- Size: 56.6 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - dbroeglin/Forge.Module - Forge generator for PowerShell modules (PowerShell)
README
[![Build status](https://ci.appveyor.com/api/projects/status/iqnrxl6xuew4suu8?svg=true)](https://ci.appveyor.com/project/dbroeglin/forge-module)
# Forge Generator for PowerShell modules
This module contains Forge generators for PowerShell modules.
`New-ForgeModule` generates a new module and `New-ForgeModuleFunction` generates a new
function inside an already created module.The generator is still quite new (and probably a bit opinionated) parts of the structure
come from the excellent https://github.com/devblackops/NetScaler module and quite a bit of
the rest comes from another similar project https://github.com/PowerShell/Plaster# Installation
Install-Module Forge.Module
# Example
The following commands should generate a module named `PoshTodo`:
New-ForgeModule -Name PoshTodo -License MIT -Author Léa -Email [email protected] -Layout ModuleName
Would create, in the current directory a scaffold for module `PoshTodo` with the following
structure:./PoshTodo
├── LICENSE
├── PoshTodo
│ ├── PoshTodo.psd1
│ └── PoshTodo.psm1
├── README.md
└── TestsA skeleton function with associated Pester test file can then be generated by executing:
cd PoshTodo
New-ForgeModuleFunction -Name New-PoshTodoWhich produces the following result:
./PoshTodo
├── LICENSE
├── PoshTodo
│ ├── New-PoshTodo.ps1
│ ├── PoshTodo.psd1
│ └── PoshTodo.psm1
├── README.md
└── Tests
├── Manifest.Tests.ps1
└── New-PoshTodo.Tests.ps1Adding the `-Editor VSCode` parameter will generate workspace configuration files for the
_Visual Studio Code_ editor. For instance, it will generate a list of task that allow to
run tests and other lifecycle operations from inside the editor.Depending on your preferences the module can be generated with two different build systems
(or none if you do not need or want one).To generate PSake integration:
New-ForgeModule -Name PoshTodo -Build PSake
To generate InvokeBuild integration:
New-ForgeModule -Name PoshTodo -Build InvokeBuild
With all options activated we get:
New-ForgeModule -Name PoshTodo -License MIT -Author Léa -Email [email protected] `
-Editor VSCode -Build PSake `
-Description "A Powershell TODO list handler" `
-Layout ModuleNameWhich would generate the following project:
./PoshTodo
├── LICENSE
├── PoshTodo
│ ├── PoshTodo.psd1
│ └── PoshTodo.psm1
├── README.md
├── ScriptAnalyzerSettings.psd1
├── Tests
│ └── Manifest.Tests.ps1
├── build.ps1
├── build.psake.ps1
└── build.settings.ps1# Dependencies
## Run time
At run time, the following modules are required:
Install-Module Forge
## Build time
Additionally, at build time, the following modules are required:
Install-Module Pester