A GitHub template repository for authoring high-quality PowerShell modules in VS Code.
- Module layout —
src/<Module>/withPublic/andPrivate/function folders, a dev-mode.psm1loader, and a proper manifest - Build system — Invoke-Build script that assembles functions into a single distributable
.psm1and syncsFunctionsToExport - Testing — Pester v5 suite covering the manifest, exports, and function behavior
- Linting — PSScriptAnalyzer with a checked-in settings file shared by VS Code and CI
- CI/CD — GitHub Actions: tests on Windows/Linux/macOS (PowerShell 7) plus Windows PowerShell 5.1; publish to the PowerShell Gallery on release
- VS Code integration — tasks (build/test/analyze/docs), debug configs, formatting settings, recommended extensions
- Docs — optional platyPS markdown help generation (
./build.ps1 -Task Docs) - Community files — issue templates, PR template, Dependabot for actions
-
Click Use this template on GitHub and create your repository
-
Clone it, then initialize:
./Initialize-Template.ps1 -ModuleName 'MyModule' -Author 'Your Name' -Description 'What it does.' -GitHubOwner 'yourusername'
This renames everything, regenerates the module GUID, and deletes itself.
-
Verify the build:
./build.ps1 # Analyze + Test (installs build dependencies on first run)
-
Start writing functions in
src/MyModule/Public/— one file per function, matching the function name.
| Command | Purpose |
|---|---|
./build.ps1 |
Default: Analyze + Test |
./build.ps1 -Task Build |
Assemble the module into output/ |
./build.ps1 -Task Test |
Build, then run Pester tests |
./build.ps1 -Task Analyze |
Run PSScriptAnalyzer |
./build.ps1 -Task Docs |
Generate markdown help (requires platyPS) |
The same tasks are available in VS Code via Terminal → Run Task.
Create a GitHub release and the publish workflow pushes the built module to the PowerShell Gallery. Requires a PSGALLERY_API_KEY repository secret.
- One public function per file in
Public/, filename = function name - Internal helpers live in
Private/and are never exported - Comment-based help on every public function
masteris protected by CI; all changes come through PRs
This template was scaffolded with Claude Code, powered by the Claude Fable 5 model (claude-fable-5).