Skip to content

Files

Latest commit

 

History

History
52 lines (35 loc) · 979 Bytes

AvoidSemicolonsAsLineTerminators.md

File metadata and controls

52 lines (35 loc) · 979 Bytes

Pattern: Use of ; as line terminator

Issue: -

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 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

Configuration

Rules = @{
    PSAvoidSemicolonsAsLineTerminators  = @{
        Enable     = $true
    }
}

Parameters

Enable: bool (Default value is $false)

Enable or disable the rule during ScriptAnalyzer invocation.

Further Reading