PSGenerator
Give PSGenerator a container image and a description of the commands it should
expose, and it writes you a PowerShell module. Your users then run
Invoke-Thing -Message hello instead of remembering a docker run line.
Status: Version 1. The generator, the container packaging contract, and the documentation are complete. The first published package is still pending.
Run It
Two ways, both fine. Pick one.
Container image — nothing to install, PowerShell and the module are already inside:
docker run --rm -it `
-v ${PWD}:/workspace `
ghcr.io/the-running-dev/subzerodev.psgenerator:latest
PowerShell module — if you already have PowerShell 7.4 or later:
Import-Module SubZeroDev.PSGenerator
Installing the module from GitHub Packages needs one-time authentication; see Installation for that and for running from a source checkout.
Your First Module
Describe a command in PSModule/PSModule.psd1, then:
Test-PSModuleSpecification -Specification ./PSModule/PSModule.psd1
Build-PSModule -Specification ./PSModule/PSModule.psd1 -Output ./artifacts/PSModule
Import-Module ./artifacts/PSModule/YourModule.psd1 -Force
Get-Help Invoke-YourCommand -Full
Build Your First Module
walks through it end to end. To try the complete Docker lifecycle against a real
image, run ./examples/Minimal/Run-Example.ps1 from a source checkout.
Documentation
The manual lives at psgenerator.subzerodev.com.
Using — install it, describe your commands, package the result:
- Installation
- Build Your First Module
- Script Directory Inference
- Runtime Mappings
- Container Packaging
- Specification Reference
- Troubleshooting
Developing — how PSGenerator itself is built:
How It Works
Specification
│
▼
Build-PSModule
│
▼
Generated PowerShell module
│
├── import and test locally
└── copy to /PSModule in the image
│
▼
Install-PSModule
Generated commands are ordinary PowerShell: native types, ValidateSet,
ValidateRange, ValidatePattern, static completion, comment-based help,
Markdown references, -WhatIf, verbose tracing, and ordered Docker arguments.
If your directory already has scripts, inference can turn standalone .ps1 files
and explicitly exported module functions beneath scripts into commands without
sweeping in unrelated PowerShell.
Platform and Trust Boundary
PowerShell 7.4 is the minimum runtime. Windows and Linux are supported and tested; macOS is best-effort for Version 1.
Local plugins are trusted, unsandboxed PowerShell. Review them before running the generator against a directory you did not write.
License
Released under the MIT License.