Skip to content

Cmdlet Reference

PSScriptBuilder provides 38 public cmdlets, grouped below into five categories that follow the natural project lifecycle: scaffolding a new project, building and assembling scripts, analyzing and validating a project's structure, managing shared configuration, and handling releases. Each entry links to a full reference page generated directly from that cmdlet's own comment-based help — the same syntax, parameter list, and usage examples Get-Help -Full already shows you in the console, organized here for browsing instead.

Many of these cmdlets return PowerShell objects rather than plain values. For what those objects actually contain — their properties, types, and how several of them relate to one another — see the Type Reference.

Scaffolding

Start a brand-new project from nothing: folder structure, configuration file, and a first template, ready for the first build.

Cmdlet Description
New-PSScriptBuilderProject Scaffolds a new PSScriptBuilder project structure
New-PSScriptBuilderTemplate Generates a PSScriptBuilder template file from a content collector configuration

Script Building

The core pipeline: define collectors, assemble a build, watch for source changes, post-process the output, and trace results back to their original source files.

Cmdlet Description
New-PSScriptBuilderContentCollector Creates a new content collector for managing multiple component collectors
New-PSScriptBuilderCollector Creates a new collector for PowerShell script components
Add-PSScriptBuilderCollector Adds a collector to a ContentCollector for fluent pipeline configuration
Get-PSScriptBuilderCollector Retrieves collectors from a ContentCollector
Get-PSScriptBuilderCollectorContent Retrieves collected data from a collector
Remove-PSScriptBuilderCollector Removes a collector from a ContentCollector
Invoke-PSScriptBuilderBuild Executes the complete PowerShell script build process
Watch-PSScriptBuilderProject Watches project source files and triggers a build or custom script block on every change
Compress-PSScriptBuilderScript Post-processes a built PowerShell script by removing comments, blank lines, or output statements
Format-PSScriptBuilderBuildResult Formats and displays the result of a build operation
Export-PSScriptBuilderBuildResult Exports a build result to a JSON file
Resolve-PSScriptBuilderSourceLocation Resolves an output script line number or ErrorRecord back to its source file location
Get-PSScriptBuilderSourceCoverage Translates Pester code coverage data back to the original source files
Format-PSScriptBuilderSourceCoverage Formats and displays per-source-file code coverage results

Analysis & Validation

Inspect a project's dependency graph, template structure, and collector configuration without necessarily running a build — useful for debugging and for CI checks that should fail fast.

Cmdlet Description
Get-PSScriptBuilderDependencyAnalysis Analyzes dependencies between components without performing a build
Format-PSScriptBuilderDependencyAnalysis Formats and displays the result of a dependency analysis operation
Get-PSScriptBuilderComponentDependency Retrieves all dependencies or dependents of a named component from the dependency graph
Find-PSScriptBuilderUnusedComponent Finds unused components in a PSScriptBuilder content collector configuration
Export-PSScriptBuilderDependencyGraph Exports the dependency graph to a visual diagram format
ConvertTo-PSScriptBuilderComponentDependencyTree Converts component dependency entries to a hierarchical tree string
Get-PSScriptBuilderTemplateAnalysis Analyzes a template file for placeholders and structure
Format-PSScriptBuilderTemplateAnalysis Formats and displays the result of a template analysis operation
Test-PSScriptBuilderTemplate Validates a template file without performing a build

Configuration

Read, create, and pin the project-wide settings — paths, defaults, and the project root — that every other cmdlet relies on.

Cmdlet Description
Get-PSScriptBuilderConfiguration Retrieves the global PSScriptBuilder configuration
New-PSScriptBuilderConfiguration Creates a new PSScriptBuilder configuration file with default values
Set-PSScriptBuilderProjectRoot Sets the PSScriptBuilder project root directory

Release Management

Track version numbers and other release metadata, then propagate them into the files that need to reflect the current version — templates, manifests, and changelogs.

Cmdlet Description
New-PSScriptBuilderReleaseData Creates a new release data file with default values
Get-PSScriptBuilderReleaseData Retrieves the current release data configuration
Get-PSScriptBuilderReleaseDataTokens Retrieves available release data tokens for substitution in bump files
Test-PSScriptBuilderReleaseData Tests the release data file for validity
Update-PSScriptBuilderReleaseData Updates release data including version and metadata
Format-PSScriptBuilderReleaseDataResult Formats and displays the result of a release data update operation
Get-PSScriptBuilderBumpConfiguration Retrieves the bump configuration
Test-PSScriptBuilderBumpConfiguration Tests the bump configuration file for validity
Update-PSScriptBuilderBumpFiles Updates configured project files with current version information
Format-PSScriptBuilderBumpResult Formats and displays the result of a bump operation