-
Notifications
You must be signed in to change notification settings - Fork 0
PowerShell code analysis
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).
$errorRules = Get-ScriptAnalyzerRule -Severity Error,Warning
Invoke-ScriptAnalyzer -Path .\src\HyperVServer\HyperVServer\HyperVServer.ps1 -IncludeRule $errorRules -ExcludeRule PSAvoidUsingWriteHost
Invoke-ScriptAnalyzer -Path .\src\HyperVServer\HyperVServer\ -CustomRulePath .\build\CommunityAnalyzerRules -Severity Warning,Error