Project

PSPublishModule

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

Stars47
Forks16
Open issues0
PowerShell Gallery downloads17213
Releasev3.0.131
Language: C# Updated: 2026-09-02T21:02:59.0000000+00:00

Curated Examples

README

Module Testing Examples

This folder contains examples showing different ways to use the PSPublishModule testing functions.

Quick Reference

Simple Testing (99% of users)

# Just run this - it does everything automatically
Invoke-ModuleTestSuite

CI/CD Integration

# For automated pipelines
Invoke-ModuleTestSuite -CICD -EnableCodeCoverage

Example Files

  1. Example.ModuleTestingBasic.ps1 - Basic usage, one command does everything
  2. Example.ModuleTestingAdvanced.ps1 - Custom options but still one command
  3. Example.ModuleTestingCICD.ps1 - Simple CI/CD integration
  4. Example.ModuleTestingCICDAdvanced.ps1 - CI/CD with custom result processing

Which Example Should I Use?

  • Most users: Start with Example.ModuleTestingBasic.ps1
  • Need custom modules/settings: Use Example.ModuleTestingAdvanced.ps1
  • CI/CD pipeline: Use Example.ModuleTestingCICD.ps1
  • Advanced CI/CD: Use Example.ModuleTestingCICDAdvanced.ps1

Key Point

The main function Invoke-ModuleTestSuite does everything automatically:

  • Finds your module manifest
  • Installs missing dependencies
  • Imports your module
  • Runs all tests
  • Shows results

For deeper troubleshooting, use Get-ModuleInformation to inspect the manifest data, then rerun Invoke-ModuleTestSuite with different switches/paths.