Skip to content

Repository files navigation

NewModuleTemplate NewModuleTemplate Icon

PowerShell Gallery

Downloads

License: MIT

A professional scaffolding generator for PowerShell modules.

Creates complete, production‑ready module structures with tests, documentation, analyzer settings, strict mode, and Git initialization (full mode only).


📦 Module Metadata

Field Value
Name NewModuleTemplate
Author Kael Sterling
Company Untapped Technologies
License MIT
Tags PowerShell, Module, Scaffolding, Template

🧰 Optional Developer Tools

The scaffolder can generate files that integrate with the following tools:

  • Pester – for running tests
  • PlatyPS – for generating documentation
  • PSScriptAnalyzer – for linting and best practices

These tools are not required for the module to function, and are not included when using -Minimal.


📚 Documentation

This module includes PlatyPS‑generated Markdown help (full mode only).

  • Docs folder: Docs\
  • Update script: Scripts\Update-ModuleDocumentation.ps1

Regenerate docs:

pwsh Scripts\Update-ModuleDocumentation.ps1

🚀 Installation

Install from the PowerShell Gallery:

Install-Module NewModuleTemplate

Import:

Import-Module NewModuleTemplate

🏃 Running the Module

Once installed and imported, you can generate a new PowerShell module scaffold using the New-ModuleTemplate command.

Full Mode (default)

Creates a complete, production‑ready module structure:

New-ModuleTemplate -Path "C:\Projects" -Name "MyModule"

This generates:

  • Public/Private folders
  • Tests
  • Docs
  • Analyzer settings
  • Build & publish scripts
  • Git initialization
  • Manifest, loader, README, changelog

Minimal Mode

Creates only the essential module components:

New-ModuleTemplate -Path "C:\Projects" -Name "MyModule" -Minimal

Minimal mode includes:

  • Public/Private folders
  • Manifest
  • Loader
  • README
  • CHANGELOG

No Git, no tests, no docs, no analyzer, no scripts.

Overwriting Existing Files

If the module folder already exists, you can refresh the scaffolding files:

New-ModuleTemplate -Path "C:\Projects" -Name "MyModule" -Force

-Force overwrites only the files generated by the scaffolder. It does not delete your module or remove custom code.

Disabling Specific Components (Full Mode Only)

You can selectively disable parts of the full scaffold:

New-ModuleTemplate -Path "C:\Projects" -Name "MyModule" -NoTests -NoDocs -NoAnalyzer -NoScripts

Disabling Git Initialization

Git is enabled by default in full mode. To disable it:

New-ModuleTemplate -Path "C:\Projects" -Name "MyModule" -NoGit

Git is always disabled in minimal mode.


📁 Folder Structure

Full Mode

MyModule/

  MyModule.psm1
  MyModule.psd1

  Public/
  Private/
  Tests/
  Docs/
  Scripts/
  Analyzer/

  README.md
  CHANGELOG.md
  .gitignore
  .git/

Minimal Mode

MyModule/

  MyModule.psm1
  MyModule.psd1

  Public/
  Private/

  README.md
  CHANGELOG.md

🧪 Testing (full mode)

Invoke-Pester -Path Tests

🔧 Build Script (full mode)

pwsh Scripts\build.ps1

📤 Publish Script (full mode)

pwsh Scripts\publish.ps1 -ApiKey '<Your PSGallery API Key>'

📄 License

MIT

About

Scaffolding generator for professional PowerShell modules.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages