Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Invoke-ModuleTestSuite

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

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

Remarks

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

PS>


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

PS>


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

Optimizes output for CI and returns a structured result object.

Pipe results into Get-ModuleTestFailures

PS>


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

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

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.

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

Parameters

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

Outputs

System.Object