Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

PowerShell code analysis

Nico Orschel edited this page Dec 28, 2018 · 2 revisions

Currently, the project follows two code analysis rule sets based on the PSScriptAnalyzer tool: a) Community rules (see commits) b) Standard rules of PSScriptAnalyzer (severity category error and warning)

In the build, the community rules are checked by default and if a violation is detected, the build is aborted. In addition, the standard rules of PSScriptAnalyzer (Error and Warning) will also be integrated into the build (work in progress).

PSScriptAnalyzer Defaultrules

$errorRules = Get-ScriptAnalyzerRule -Severity Error,Warning

Invoke-ScriptAnalyzer -Path .\src\HyperVServer\HyperVServer\HyperVServer.ps1 -IncludeRule $errorRules -ExcludeRule PSAvoidUsingWriteHost

CommunityAnalyzerRules

Invoke-ScriptAnalyzer -Path .\src\HyperVServer\HyperVServer\ -CustomRulePath .\build\CommunityAnalyzerRules -Severity Warning,Error

Suppress rules

Rule Suppression

Clone this wiki locally