PSMutant

0.2.2

Mutation testing for PowerShell. Injects small faults (flip -eq to -ne, $true to $false, N to N+1, drop -not) into your scripts using the PowerShell AST and reports how many your Pester suite catches - the metric line coverage cannot give you. Runs mutants in a throwaway sandbox so your source is never modified.

Minimum PowerShell version

7.2

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSMutant

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSMutant

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) Fortigi. MIT licensed.

Package Details

Author(s)

  • Fortigi

Tags

mutation-testing testing pester ast quality test-quality coverage

Functions

Invoke-PSMutation Get-PSMutationCandidate Set-PSMutationText

Dependencies

Release Notes

Fixes a silent, entirely fake 100% score on any machine with two Pester versions installed. Mutants run in a child runspace, and that runspace resolved Pester by name - getting the newest version installed rather than the one already loaded. Assemblies are per-process, so the child died on an incompatible Pester.dll, produced no verdict, and a mutant with no verdict was counted as Killed: every mutant died and the run reported a perfect score over tests that never ran. The child is now pinned to the loaded module's path, and a run that cannot evaluate a mutant fails instead of scoring it. Also fixes an abort when a suitable Pester was already loaded. Coverage and self-mutation both at 100%.

FileList

Version History

Version Downloads Last updated
0.2.2 (current version) 5 8/18/2026
0.2.1 5 8/18/2026
0.2.0 6 8/17/2026
0.1.0 81 7/3/2026