Command Reference
Import the generator before using these commands:
Import-Module ./src/SubZeroDev.PSGenerator.psd1 -Force
Build-PSModule
Runs all seven ordered stages and writes a complete module.
Build-PSModule `
[-Specification <string>] `
[-Output <string>] `
[-PluginPath <string[]>]
| Parameter | Default | Description |
|---|---|---|
Specification | PSModule/PSModule.psd1 | Directory PSD1 |
Output | artifacts/PSModule | Generated module directory |
PluginPath | Conventional sibling Plugins | Additional trusted plugin roots |
Built-in plugins always execute. Explicit plugin paths are added to built-ins. When
PluginPath is omitted, a Plugins directory beside the specification is used when
present.
Returns the generated Metadata/model.json FileInfo.
Test-PSModuleSpecification
Runs built-in Version 1 validators without generating output:
Test-PSModuleSpecification `
[-Specification <string>]
Returns True or throws a terminating error.
Get-PSModuleModel
Validates and normalizes a specification:
Get-PSModuleModel `
[-Specification <string>]
Returns SubZeroDev.PSGenerator.Model with module identity, container
image, commands, parameters, validations, completions, mappings, and original
definition objects.
Initialize-PSModuleSpecification
Inspects a directory and writes an initial scaffold:
Initialize-PSModuleSpecification `
[-Directory <string>] `
[-Specification <string>] `
[-Force] `
[-PassThru] `
[-WhatIf]
| Parameter | Default | Description |
|---|---|---|
Directory | . | Directory to inspect |
Specification | PSModule/PSModule.psd1 | Relative or absolute destination |
Force | False | Replace an existing specification |
PassThru | False | Return the created FileInfo |
Without -PassThru, successful creation has no pipeline output.
Initialize-PSModuleDirectory
Prepares a directory and reports what it produced, in one call:
Initialize-PSModuleDirectory `
-Directory <string> `
[-Specification <string>] `
[-Output <string>] `
[-Generate] `
[-ListCommands] `
[-NoInitialize]
| Parameter | Default | Description |
|---|---|---|
Directory | Required | Directory to prepare |
Specification | PSModule/PSModule.psd1 | Relative to Directory, or absolute |
Output | artifacts/PSModule | Relative to Directory, or absolute |
Generate | False | Generate, import globally, return the artifact |
ListCommands | False | Generate, import globally, return exported commands |
NoInitialize | False | Fail on a missing specification instead of scaffolding |
Scaffolds a specification when none exists, generates the module, imports it globally, and returns the normalized model, the generated artifact, or the exported commands depending on the switches. An authored specification is never overwritten; only a missing, empty, or unmapped generator-owned scaffold is created or refreshed.
See Point PSGenerator at a Directory.
Get-PSModuleInspection
Runs inspector plugins without generating a module:
Get-PSModuleInspection `
[-Specification <string>] `
[-PluginPath <string[]>]
Returns SubZeroDev.PSGenerator.InspectionResult:
| Property | Meaning |
|---|---|
DirectoryPath | Resolved directory |
SpecificationPath | Resolved PSD1 |
Data | Ordered inspection dictionary |
PluginExecutions | Ordered execution records |
Get-PSModuleDiagnostic
Formats execution records from an inspection or runs inspection directly:
Get-PSModuleDiagnostic `
[-Specification <string>] `
[-PluginPath <string[]>] `
[-Detailed]
$inspection | Get-PSModuleDiagnostic [-Detailed]
The concise output contains stage, execution order, plugin, duration, and success.
-Detailed adds path, start time, and error text.
Get-PSModulePlugin
Discovers plugins without executing them:
Get-PSModulePlugin `
-Path <string[]> `
[-Stage <string[]>]
Valid stages:
InspectorsValidatorsObjectModelProcessorsRuntimeAdaptersCodeGeneratorsTemplateRenderersPackagingProviders
Returns deterministic plugin metadata including stage, execution order, numeric
prefix, name, filename, and resolved path. Roots must be unique and filenames must
match <numeric-prefix>.<name>.ps1.
Install-PSModule
Copies and validates /PSModule from an image:
Install-PSModule `
-Image <string> `
[-Destination <string>] `
[-Force] `
[-WhatIf]
| Parameter | Default | Description |
|---|---|---|
Image | Required | Safe Docker image reference |
Destination | ~/PSModule | Local installation directory |
Force | False | Replace after staged validation |
Returns the installed directory as DirectoryInfo.
Generated Commands
Generated container-backed commands:
- expose specification parameters;
- support
-WhatIf; - emit verbose runtime details;
- call
docker run --rm; - throw when Docker is missing; and
- throw when Docker returns a non-zero exit code.
Inferred Script and ModuleFunction commands execute their packaged PowerShell
source rather than Docker.