Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-17
Command

Invoke-ModuleTestSuite

Module PSPublishModule
Inputs
None

Complete module testing suite that handles dependencies, imports, and test execution.

Syntax

Invoke-ModuleTestSuite [-AdditionalModules <String[]>] [-CICD] [-EnableCodeCoverage] [-ExitOnFailure] [-FailureSummaryFormat <Summary|Detailed>] [-Force] [-OutputFormat <Detailed|Normal|Minimal>] [-PassThru] [-ProjectPath <String>] [-ShowFailureSummary] [-SkipDependencies] [-SkipImport] [-SkipModules <String[]>] [-TestPath <String>] [-TimeoutSeconds <Int32>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Executes module tests out-of-process, installs required dependencies, and provides a summary that is suitable for both local development and CI pipelines.

For post-processing failures (e.g. emitting JSON summaries), combine it with Get-ModuleTestFailures.

Examples

Authored help example

Run the full test suite for a module

Invoke-ModuleTestSuite -ProjectPath 'C:\Git\MyModule'

Runs tests under the module project folder, installs dependencies, and prints a summary.

Run in CI mode and return the result object

Invoke-ModuleTestSuite -ProjectPath 'C:\Git\MyModule' -CICD -PassThru

Optimizes output for CI and returns a structured result object.

Pipe results into Get-ModuleTestFailures

Invoke-ModuleTestSuite -ProjectPath 'C:\Git\MyModule' -PassThru | Get-ModuleTestFailures -OutputFormat Summary

Produces a concise failure summary that can be used in CI logs.

Parameters

-AdditionalModules String[] optional
Additional modules to install beyond those specified in the manifest.
-CICD SwitchParameter optional
Enable CI/CD mode with optimized settings and output.
-EnableCodeCoverage SwitchParameter optional
Enable code coverage analysis during tests.
-ExitOnFailure SwitchParameter optional
Set a non-zero process exit code when tests fail.
-FailureSummaryFormat ModuleTestSuiteFailureSummaryFormat optional
Format for failure summary display.
Possible values: Summary, Detailed
-Force SwitchParameter optional
Force reinstall of modules and reimport of the target module.
-OutputFormat ModuleTestSuiteOutputFormat optional
Test output format.
Possible values: Detailed, Normal, Minimal
-PassThru SwitchParameter optional
Return the test suite result object.
-ProjectPath String optional
Path to the PowerShell module project directory.
-ShowFailureSummary SwitchParameter optional
Display detailed failure analysis when tests fail.
-SkipDependencies SwitchParameter optional
Skip dependency checking and installation.
-SkipImport SwitchParameter optional
Skip module import step.
-SkipModules String[] optional
Array of module names to skip during installation.
-TestPath String optional
Custom path to test files (defaults to Tests folder in project).
-TimeoutSeconds Int32 optional
Timeout for the out-of-process test execution, in seconds.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.