Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
* @PowerShell/extension @bergmeister

# Version bumps and documentation updates
Directory.Build.props @sdwheeler @michaeltlombardi
Directory.Build.props @PowerShell/extension @sdwheeler @michaeltlombardi
/docs/ @PowerShell/extension @sdwheeler @michaeltlombardi
15 changes: 8 additions & 7 deletions docs/Rules/AvoidLongLines.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid long lines
ms.date: 06/28/2023
ms.date: 04/29/2025
ms.topic: reference
title: AvoidLongLines
---
Expand All @@ -10,10 +10,11 @@ title: AvoidLongLines

## Description

Lines should be no longer than a configured number of characters (default: 120), including leading
whitespace (indentation).
The length of lines, including leading spaces (indentation), should be less than the configured number
of characters. The default length is 120 characters.

**Note**: This rule is not enabled by default. The user needs to enable it through settings.
> [!NOTE]
> This rule isn't enabled by default. The user needs to enable it through settings.

## Configuration

Expand All @@ -26,12 +27,12 @@ Rules = @{
}
```

### Parameters
## Parameters

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

Enable or disable the rule during ScriptAnalyzer invocation.

#### MaximumLineLength: int (Default value is 120)
### `MaximumLineLength`: int (Default value is 120)

Optional parameter to override the default maximum line length.
16 changes: 9 additions & 7 deletions docs/Rules/AvoidReservedWordsAsFunctionNames.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ title: AvoidReservedWordsAsFunctionNames

## Description

Avoid using reserved words as function names. Using reserved words as function
names can cause errors or unexpected behavior in scripts.
Avoid using reserved words as function names. Using reserved words as function names can cause
errors or unexpected behavior in scripts.

## How to Fix

Avoid using any of the reserved words as function names. Instead, choose a
different name that is not reserved.
Avoid using any of the reserved words as function names. Choose a different name that's not a
reserved word.

See [`about_Reserved_Words`](https://learn.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_reserved_words) for a list of reserved
words in PowerShell.
See [about_Reserved_Words][01] for a list of reserved words in PowerShell.

## Example

Expand All @@ -39,4 +38,7 @@ function function {
function myFunction {
Write-Host "Hello, World!"
}
```
```

<!-- link references -->
[01]: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_reserved_words
14 changes: 7 additions & 7 deletions docs/Rules/UseCorrectCasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: UseCorrectCasing
## Description

This is a style/formatting rule. PowerShell is case insensitive wherever possible, so the casing of
cmdlet names, parameters, keywords and operators does not matter. This rule nonetheless ensures
cmdlet names, parameters, keywords and operators doesn't matter. This rule nonetheless ensures
consistent casing for clarity and readability. Using lowercase keywords helps distinguish them from
commands. Using lowercase operators helps distinguish them from parameters.

Expand All @@ -34,23 +34,23 @@ Rules = @{
}
```

### Parameters
## Parameters

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

Enable or disable the rule during ScriptAnalyzer invocation.

#### CheckCommands: bool (Default value is `$true`)
### CheckCommands: bool (Default value is `$true`)

If true, require the case of all command and parameter names to match their canonical casing.

#### CheckKeyword: bool (Default value is `$true`)
### CheckKeyword: bool (Default value is `$true`)

If true, require the case of all keywords to be lowercase.

#### CheckOperator: bool (Default value is `$true`)
### CheckOperator: bool (Default value is `$true`)

If true, require the case of all operators (e.g. -eq, -ne, -gt) to be lowercase.
If true, require the case of all operators to be lowercase. For example: `-eq`, `-ne`, `-gt`

## Examples

Expand Down