> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# powershell/PSAvoidSemicolonsAsLineTerminators

> Avoid semicolons as line terminators

`powershell/PSAvoidSemicolonsAsLineTerminators` is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

| Property | Value            |
| -------- | ---------------- |
| Severity | Warning          |
| Category | PSScriptAnalyzer |
| Auto-fix | No               |

## Description

Lines should not end with a semicolon.

<Note>
  This rule is not enabled by default. The user needs to enable it through settings.
</Note>

## Examples

### Problematic code

```powershell theme={null}
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b;
```

```powershell theme={null}
Install-Module -Name PSScriptAnalyzer;
$a = 1 + $b
```

### Correct code

```powershell theme={null}
Install-Module -Name PSScriptAnalyzer; $a = 1 + $b
```

```powershell theme={null}
Install-Module -Name PSScriptAnalyzer
$a = 1 + $b
```

## Configuration

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

### Parameters

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

Enable or disable the rule during ScriptAnalyzer invocation.

## Source

This rule documentation is adapted from Microsoft's PSScriptAnalyzer documentation for
[AvoidSemicolonsAsLineTerminators](https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/blob/main/reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidSemicolonsAsLineTerminators.md),
licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
