Skip to main content

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[]>]
ParameterDefaultDescription
SpecificationPSModule/PSModule.psd1Directory PSD1
Outputartifacts/PSModuleGenerated module directory
PluginPathConventional sibling PluginsAdditional 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]
ParameterDefaultDescription
Directory.Directory to inspect
SpecificationPSModule/PSModule.psd1Relative or absolute destination
ForceFalseReplace an existing specification
PassThruFalseReturn 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]
ParameterDefaultDescription
DirectoryRequiredDirectory to prepare
SpecificationPSModule/PSModule.psd1Relative to Directory, or absolute
Outputartifacts/PSModuleRelative to Directory, or absolute
GenerateFalseGenerate, import globally, return the artifact
ListCommandsFalseGenerate, import globally, return exported commands
NoInitializeFalseFail 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:

PropertyMeaning
DirectoryPathResolved directory
SpecificationPathResolved PSD1
DataOrdered inspection dictionary
PluginExecutionsOrdered 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:

  • Inspectors
  • Validators
  • ObjectModelProcessors
  • RuntimeAdapters
  • CodeGenerators
  • TemplateRenderers
  • PackagingProviders

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]
ParameterDefaultDescription
ImageRequiredSafe Docker image reference
Destination~/PSModuleLocal installation directory
ForceFalseReplace 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.