Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 947 Bytes

AvoidSemicolonsAsLineTerminators.md

File metadata and controls

57 lines (41 loc) · 947 Bytes
description ms.custom ms.date ms.topic title
Avoid semicolons as line terminators
PSSA v1.22.0
06/28/2023
reference
AvoidSemicolonsAsLineTerminators

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.