-
Notifications
You must be signed in to change notification settings - Fork 1
Home
This is a PowerShell module which runs a series of Pester 5 tests to validate code quality. It uses a combination of Pester tests, PSScriptAnalyzer and a set of quality standards to ensure consistent quality on PowerShell scripts and modules.
The module is available on the PowerShell Gallery
The standards that these scripts are enforcing are detailed here: Standards
The rules that are tested are detailed here: Module Tests and here: Script Tests
Import the module
Import-Module -Name PSQualityCheck
Invoke-PSQualityCheck -Path 'C:\Scripts'
Invoke-PSQualityCheck -Path @('C:\Scripts', 'C:\MoreScripts')
Invoke-PSQualityCheck -File 'C:\Scripts\Script.ps1'
Invoke-PSQualityCheck -File @('C:\Scripts\Script.ps1', 'C:\Scripts\Script.ps1')
Invoke-PSQualityCheck -File 'C:\Scripts\Script.ps1' -SonarQubeRulesPath 'C:\SonarQubeRules'
Check the folder C:\Scripts and all subfolders beneath it and display a summary of the checks performed:
Invoke-PSQualityCheck -Path 'C:\Scripts' -ShowCheckResults
output below uses sample data:
Test Files Tested Total Passed Failed Skipped
---- ------------ ----- ------ ------ -------
Module Tests 3 21 20 1 0
Extracting functions 3 3 3 0 0
Extracted function script tests 13 195 64 114 17
Script Tests 17 255 78 152 25
Total 33 474 165 267 42
The plan for the future of the module is detailed here: Release Plan