Giter VIP home page Giter VIP logo

forge.module's Introduction

Build status

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
└── Tests

A skeleton function with associated Pester test file can then be generated by executing:

cd PoshTodo
New-ForgeModuleFunction -Name New-PoshTodo

Which produces the following result:

./PoshTodo
├── LICENSE
├── PoshTodo
│   ├── New-PoshTodo.ps1
│   ├── PoshTodo.psd1
│   └── PoshTodo.psm1
├── README.md
└── Tests
    ├── Manifest.Tests.ps1
    └── New-PoshTodo.Tests.ps1

Adding 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 ModuleName

Which 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

forge.module's People

Contributors

dbroeglin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jajp777

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.