Pattern: Use of ;
as line terminator
Issue: -
Lines should not end with a semicolon.
Note
This rule is not enabled by default. The user needs to enable it through settings.
Example of incorrect code:
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;
Install-Module -Name PSScriptAnalyzer;
$a = 1 + $b
Example of correct code:
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b
Install-Module -Name PSScriptAnalyzer
$a = 1 + $b
Rules = @{
PSAvoidSemicolonsAsLineTerminators = @{
Enable = $true
}
}
Enable or disable the rule during ScriptAnalyzer invocation.