AvoidSemicolonsAsLineTerminators
Severity Level: Warning
Description
Lines should not end with a semicolon.
Note
This rule is not enabled by default. The user needs to enable it through settings.
Example
Wrong
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;
Install-Module -Name PSScriptAnalyzer;
$a = 1 + $b
Correct
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b
Install-Module -Name PSScriptAnalyzer
$a = 1 + $b
Configuration
Rules = @{
PSAvoidSemicolonsAsLineTerminators = @{
Enable = $true
}
}
Parameters
Enable: bool (Default value is $false
)
Enable or disable the rule during ScriptAnalyzer invocation.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for