PSScriptBuilder

1.3.0

Build a single deployable PowerShell script from a multi-file project. PSScriptBuilder resolves class inheritance and dependency order automatically using AST analysis - no manual ordering required. Supports classes, enums, functions, template-based output, and release management.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSScriptBuilder

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSScriptBuilder

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Tim Hartling. All rights reserved.

Package Details

Author(s)

  • Tim Hartling

Tags

PSScriptBuilder Build BuildTool Classes ClassDependency DependencyResolution TopologicalSort AST ReleaseManagement SemVer ModuleBuilder Deployment Automation PowerShell5 PowerShell7 Windows Linux MacOS

Functions

Add-PSScriptBuilderCollector Compress-PSScriptBuilderScript ConvertTo-PSScriptBuilderComponentDependencyTree Export-PSScriptBuilderBuildResult Export-PSScriptBuilderDependencyGraph Find-PSScriptBuilderUnusedComponent Format-PSScriptBuilderBuildResult Format-PSScriptBuilderBumpResult Format-PSScriptBuilderDependencyAnalysis Format-PSScriptBuilderReleaseDataResult Format-PSScriptBuilderSourceCoverage Format-PSScriptBuilderTemplateAnalysis Get-PSScriptBuilderBumpConfiguration Get-PSScriptBuilderCollector Get-PSScriptBuilderCollectorContent Get-PSScriptBuilderComponentDependency Get-PSScriptBuilderConfiguration Get-PSScriptBuilderDependencyAnalysis Get-PSScriptBuilderReleaseData Get-PSScriptBuilderReleaseDataTokens Get-PSScriptBuilderSourceCoverage Get-PSScriptBuilderTemplateAnalysis Invoke-PSScriptBuilderBuild New-PSScriptBuilderCollector New-PSScriptBuilderConfiguration New-PSScriptBuilderContentCollector New-PSScriptBuilderProject New-PSScriptBuilderReleaseData New-PSScriptBuilderTemplate Remove-PSScriptBuilderCollector Resolve-PSScriptBuilderSourceLocation Set-PSScriptBuilderProjectRoot Test-PSScriptBuilderBumpConfiguration Test-PSScriptBuilderReleaseData Test-PSScriptBuilderTemplate Update-PSScriptBuilderBumpFiles Update-PSScriptBuilderReleaseData Watch-PSScriptBuilderProject

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

v1.3.0

Added:
- Template escape syntax ({{{{KEY}}}}) for literal {{KEY}}-shaped text in templates
- Format-PSScriptBuilderSourceCoverage
- Get-PSScriptBuilderSourceCoverage
- Resolve-PSScriptBuilderSourceLocation
- -WriteSourceMap switch for Invoke-PSScriptBuilderBuild and Watch-PSScriptBuilderProject
- build.writeSourceMap configuration option
- Format-PSScriptBuilderTemplateAnalysis
- Format-PSScriptBuilderDependencyAnalysis
- Examples 16 (Source Maps) and 17 (Code Coverage)

Changed:
- Format-PSScriptBuilderBumpResult: Pattern line hidden when identical to Old Value
- Invoke-PSScriptBuilderBuild: per-phase durations reported via the verbose stream
- Configuration: build section's backupPath, orderedComponentsKey, backupEnabled, and syntaxValidationEnabled are now optional

Fixed:
- Format-PSScriptBuilderSourceCoverage: a backslash-style absolute path is now correctly shown relative to the project root on non-Windows systems
- Invoke-PSScriptBuilderBuild / Update-PSScriptBuilderBumpFiles / Update-PSScriptBuilderReleaseData / New-PSScriptBuilderProject: directory/file creation now fails clearly instead of silently doing nothing on a type collision
- Invoke-PSScriptBuilderBuild / Watch-PSScriptBuilderProject: Free Mode now consolidates Using collectors like Ordered/Hybrid Mode, preventing duplicate using statements
- Update-PSScriptBuilderBumpFiles: backup/rollback failures on PowerShell 7 no longer go undetected
- Invoke-PSScriptBuilderBuild / Watch-PSScriptBuilderProject: source files without a UTF-8 BOM are now read correctly regardless of the system codepage
- Compress-PSScriptBuilderScript: -RemoveBlankLines/-RemoveOutputStatements now preserve each line's original line ending
- Update-PSScriptBuilderBumpFiles: a pattern matching nothing now emits a warning naming the file
- Invoke-PSScriptBuilderBuild / Watch-PSScriptBuilderProject: Ordered/Hybrid Mode now validates that every Using placeholder is actually replaced
- Verbose and formatted output: file sizes and durations now format consistently regardless of system region settings
- Get-PSScriptBuilderCollector: -CollectionKey and -Type now belong to separate parameter sets
- Invoke-PSScriptBuilderBuild / Get-PSScriptBuilderDependencyAnalysis: duplicate component names (including case-only differences) now throw instead of silently collapsing
- Invoke-PSScriptBuilderBuild / Get-PSScriptBuilderDependencyAnalysis: components without dependencies are now ordered deterministically in all three modes
- Update-PSScriptBuilderBumpFiles: escaped literal braces and parentheses in patterns now work correctly; conflicting token/regex combinations now fail validation immediately
- Update-PSScriptBuilderBumpFiles: token matching is now case-insensitive; replacements no longer depend on processing order
- Invoke-PSScriptBuilderBuild / Test-PSScriptBuilderTemplate: placeholder matching is now case-insensitive everywhere, including duplicate detection
- Invoke-PSScriptBuilderBuild: inserted content is no longer re-scanned for further placeholder replacements
- Invoke-PSScriptBuilderBuild / Test-PSScriptBuilderTemplate / Get-PSScriptBuilderTemplateAnalysis: collector keys colliding with bump-file tokens or the ordered-components key now fail validation immediately
- Test-PSScriptBuilderTemplate: now collects content before analyzing dependencies, fixing false-positive cross-dependency results
- New-PSScriptBuilderConfiguration / New-PSScriptBuilderReleaseData: target/output directories are now created automatically if missing

Full changelog: https://github.com/PSScriptBuilder/PSScriptBuilder/blob/main/CHANGELOG.md

FileList

Version History

Version Downloads Last updated
1.3.0 (current version) 12 10/27/2026
1.2.0 104 8/2/2026
1.1.0 58 5/5/2026
1.0.0 18 4/14/2026