Installation¶
Requirements¶
| Requirement | Version |
|---|---|
| PowerShell | 5.1 or later (Windows PowerShell and PowerShell 7+) |
| Operating System | Windows, Linux, macOS |
PSScriptBuilder has no external dependencies beyond the PowerShell runtime.
Install from PowerShell Gallery¶
To install for all users on the machine (requires elevated permissions):
Verify the Installation¶
Importing the Module¶
Always use using module, not Import-Module
PSScriptBuilder exposes PowerShell classes and enums. PowerShell only makes class and enum
definitions available when a module is loaded with using module. With Import-Module, cmdlets
work but classes and enums are not accessible.
# Correct — classes and enums are available
using module PSScriptBuilder
# Wrong — classes and enums will NOT be available
Import-Module PSScriptBuilder
The using module statement must appear at the very top of your script, before any other code.
Project Configuration File¶
PSScriptBuilder uses a configuration file (psscriptbuilder.config.json) to locate project paths.
Place this file in the root of your project:
{
"build": {
"outputPath": ".\\build\\Output",
"ensureOutputPathExists": false,
"backupPath": ".\\build\\Output\\Backup",
"templatesPath": ".\\build\\Templates",
"orderedComponentsKey": "ORDERED_COMPONENTS",
"backupEnabled": false
},
"release": {
"dataFile": ".\\build\\Release\\psscriptbuilder.releasedata.json",
"bumpConfigFile": ".\\build\\Release\\psscriptbuilder.bumpconfig.json"
}
}
All fields are required
Every field in the configuration file must be present. The validator enforces all fields as required — omitting any field causes an error when the configuration is loaded.
PSScriptBuilder automatically discovers this file by searching the current directory and its parents. To explicitly set the project root at runtime: