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