Dependency-Aware Script Builder for PowerShell
Build single, deployable scripts from multi-file PowerShell projects — with automatic dependency resolution, topological sorting, and full support for classes, functions, and enums.
$cc = New-PSScriptBuilderContentCollector |
Add-PSScriptBuilderCollector -Type Class `
-IncludePath "src/Classes" |
Add-PSScriptBuilderCollector -Type Function `
-IncludePath "src/Public"
Invoke-PSScriptBuilderBuild `
-ContentCollector $cc `
-TemplatePath "build/MyModule.psm1.template" `
-OutputPath "build/Output/MyModule.psm1"
Everything you need to go from multi-file project to deployable script
Automatically analyzes class-to-class, function-to-class, and cross-file dependencies using PowerShell AST parsing. Detects circular dependencies early and provides clear error messages before your build fails.
Guarantees correct loading order using a proven topological sort algorithm. Base classes always load before derived classes, regardless of file order — no more manual sorting of source files.
Define your output structure once using a template with token placeholders. PSScriptBuilder replaces tokens with correctly ordered, resolved content — full control over the final script layout.
Dedicated collectors for Classes, Functions, Enums, Using statements, and raw Files. Each collector is independently configurable with custom include paths, file filters, and collection keys.
Built-in SemVer version bumping (Major/Minor/Patch), automatic file updates across your project, build number tracking, and Git information extraction for release metadata.
Catches configuration errors before the build starts. Validates template syntax, placeholder completeness, and collector configuration — then logs every step with full verbose support.
Get up and running in minutes
Install PSScriptBuilder from the PowerShell Gallery. Use using module in your build script — it makes PowerShell classes and enums available at parse time.
Install-Module -Name PSScriptBuilder
using module PSScriptBuilder
Tell PSScriptBuilder where your project lives. All relative paths are resolved from this root.
Set-PSScriptBuilderProjectRoot -Path "C:\Projects\MyModule"
Create a content collector and attach specialized collectors for each source type. The pipeline syntax keeps configuration readable and composable.
$contentCollector = New-PSScriptBuilderContentCollector |
Add-PSScriptBuilderCollector -Type Class -IncludePath "src/Classes" |
Add-PSScriptBuilderCollector -Type Function -IncludePath "src/Public"
Run the build. PSScriptBuilder collects all sources, resolves dependencies, applies topological sorting, and writes the final output file using your template.
Invoke-PSScriptBuilderBuild `
-ContentCollector $contentCollector `
-TemplatePath "build/MyModule.psm1.template" `
-OutputPath "build/Output/MyModule.psm1"
How PSScriptBuilder fits into your PowerShell development pipeline
Recognize your situation? PSScriptBuilder was built for exactly this.
You write clean, organized source files — but deployment needs a single script. Configure once, then build with a single command. All dependencies resolved, correct order guaranteed.
Your class hierarchy is growing and the loading order keeps breaking. PSScriptBuilder uses PowerShell's AST to resolve every dependency automatically — no more manual sorting, no more guesswork.
Bumping versions across multiple files before every release is tedious and error-prone. Define your output structure once with a template, and let PSScriptBuilder handle version bumping, file updates, and Git metadata automatically.
Automate your PowerShell build as part of any CI/CD pipeline. PSScriptBuilder produces a deterministic, dependency-resolved output on every run — no manual steps, no surprises.
Common questions about PSScriptBuilder