| description | Avoid semicolons as line terminators |
|---|---|
| ms.custom | PSSA v1.21.0 |
| ms.date | 06/28/2023 |
| ms.topic | reference |
| title | AvoidSemicolonsAsLineTerminators |
Severity Level: Warning
Lines should not end with a semicolon.
Note
This rule is not enabled by default. The user needs to enable it through settings.
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;Install-Module -Name PSScriptAnalyzer;
$a = 1 + $bInstall-Module -Name PSScriptAnalyzer; $a = 1 + $bInstall-Module -Name PSScriptAnalyzer
$a = 1 + $bRules = @{
PSAvoidSemicolonsAsLineTerminators = @{
Enable = $true
}
}Enable or disable the rule during ScriptAnalyzer invocation.