<commit_before>---
description: Avoid semicolons as line terminators
ms.custom: PSSA v1.21.0
ms.date: 06/15/2022
ms.topic: reference
title: 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

```powershell
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;
```

```powershell
Install-Module -Name PSScriptAnalyzer;
$a = 1 + $b
```

### Correct

```powershell
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b
```

```powershell
Install-Module -Name PSScriptAnalyzer
$a = 1 + $b
```

## Configuration

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

### Parameters

#### Enable: bool (Default value is `$false`)

Enable or disable the rule during ScriptAnalyzer invocation.
<commit_msg>Reformat note block (#1837)<commit_after>---
description: Avoid semicolons as line terminators
ms.custom: PSSA v1.21.0
ms.date: 06/15/2022
ms.topic: reference
title: 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

```powershell
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;
```

```powershell
Install-Module -Name PSScriptAnalyzer;
$a = 1 + $b
```

### Correct

```powershell
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b
```

```powershell
Install-Module -Name PSScriptAnalyzer
$a = 1 + $b
```

## Configuration

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

### Parameters

#### Enable: bool (Default value is `$false`)

Enable or disable the rule during ScriptAnalyzer invocation.

{'fraction_non_alphanumeric': 0.13316326530612244, 'fraction_numerical': 0.018367346938775512, 'mean_word_length': 4.160526315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5705546', 'n_tokens_mistral': 712, 'n_tokens_neox': 654, 'n_words': 195}