PesterForge is not on the PowerShell Gallery yet. When the listing goes live (the changelog will say so), installing is the one line you already know:
Install-Module PesterForge
Until then there is no public download. [NEEDS KEITH: how someone should get PesterForge today, ahead of the Gallery listing. The repository is private and the site has no download link to offer.] Everything below matches the module as it exists today. PesterForge needs PowerShell 5.1 or later.
Import-Module PesterForge
Four commands load with the module. Each answers to two names, a plain-English one and the original Pf-prefixed one; both always work, and this page uses the plain-English names.
New-PesterTests | Reads a script or function file and writes a ready-to-run Pester test file for it |
Measure-FunctionTestability | Reports one function's parameters, outputs, error handling, and how testable it is |
Get-PesterCoverage | Checks a module and reports which functions have Pester tests and which do not |
New-PfTestFile | Writes a test file for a function you have already profiled |
Two more commands, Start-TestRun and New-TestProject, live in the module’s Tools folder and load by dot-sourcing (step 4 shows how). Get-Help about_PesterForge prints the whole command map.
Point New-PesterTests at a function file. It reads the code without running it, learns the parameters, the outputs, and the error paths, then writes a complete test file: static checks, unit tests, and integration and acceptance placeholders for you to fill in.
New-PesterTests -ScriptPath .\Public\Get-Widget.ps1 `
-OutputPath .\Tests\Unit\Get-Widget.Tests.ps1
A result object comes back. The field names below are the real ones; the values are illustrative, not a captured run, and DecisionLog is trimmed here for width.
Status : Succeeded
Outcome : Generated test file for: Get-Widget
ErrorCategory : None
OutputPath : .\Tests\Unit\Get-Widget.Tests.ps1
BytesWritten : 9184
DecisionLog : {...}
AiEnriched : False
AiOutcome : NotAttempted
ConventionSource : None
- No API key is required for the default run; it is pure code analysis. AI enrichment is optional, and when it cannot run you still get the analysis-only file.
- An existing file at
-OutputPathis never overwritten unless you pass-Force, and even-Forcestops when the target file has uncommitted git changes. - When the generated test contains stubs, a banner at the top of the file counts them and gives you the search string (
FILL IN) to find each one. - The
DecisionLogfield records why each test exists, with a confidence tier per entry: 1 means read directly from your code, 4 means it needs a human. - Leave off
-OutputPathand the test content comes back as a string; nothing is written to disk.
The generated file is standard Pester. Run it the way you run any other test:
Invoke-Pester .\Tests\Unit\Get-Widget.Tests.ps1
You get Pester’s normal summary; the counts here are illustrative. Placeholders you have not filled in yet report as skipped rather than passing.
Tests completed in 3.42s Tests Passed: 18, Failed: 0, Skipped: 4 NotRun: 0
For a whole project there is also Start-TestRun. It is a Tools script rather than a module export, so dot-source it first, from the folder PesterForge is installed in:
. .\Tools\Invoke-PfPester.ps1 Start-TestRun -ProjectRoot . -Category Unit
-Category accepts Static, Unit, Integration, Acceptance, or All. The default is All.
One function down. To see where the rest of the module stands:
Get-PesterCoverage -ModuleRoot .
The Outcome line below shows the command’s real message format; the numbers are illustrative.
Status : Succeeded Outcome : Audited 23 functions (Layout=Suite): 15 covered, 8 missing ErrorCategory : None TotalFunctions : 23 CoveredCount : 15 MissingCount : 8
The Results array names every function and whether a test file exists for it, so the missing eight become a work list you can feed back to step 3. Layout is auto-detected: Public and Private folders beside the manifest, ModuleBuilder-style nesting, or a custom layout you name with explicit -PublicPath, -PrivatePath, and -TestsPath.
Each command here takes more parameters than this page shows: AI enrichment, project convention files, and a confidence check that runs the generated test against your function before handing it back. The features page has the full command reference, and Get-Help New-PesterTests -Full covers the same ground offline.