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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ against.

> [!NOTE]
> The default value for `PowerShellVersion` is `core-7.0.0-windows` if PowerShell 7 or later is
installed, and `desktop-5.1.17763.316-windows` if it's not.
> installed, and `desktop-5.1.17763.316-windows` if it's not.

Patched PowerShell releases usually share the same cmdlet metadata, so the built-in allow lists are
provided by major and minor version. You can also generate a custom allow list with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ title: MissingModuleManifestField

## Description

This rule detects when a module manifest is missing required fields. A module manifest is a `.psd1`
This rule detects when a module manifest is missing a required field. A module manifest is a `.psd1`
file that contains a hash table. The keys and values in the hash table describe the contents and
attributes of the module, define the prerequisites, and determine how the components are processed.

A module manifest must contain the following key (and a corresponding value) to be considered valid:
A module manifest must contain the following key-value pair to be considered valid:

- `ModuleVersion`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ title: List of PSScriptAnalyzer rules
---
# PSScriptAnalyzer Rules

The PSScriptAnalyzer module includes the following built-in rule definitions. You can disable most
configurable rules by setting the `Enable` property to `$false` in a custom rule configuration file.
Rules listed as _Always enabled_ can't be disabled using configuration. However, there are two ways
to avoid rules you don't want to use:

The PSScriptAnalyzer module includes the following built-in rule definitions. For rules that
support settings, you can enable or disable them by setting the `Enable` configuration property in
a custom settings file. Rules listed as _Always enabled_ don't expose a per-rule `Enable` property.
There are two way to avoid using these rules:
There are two ways to avoid using these rules:

- Create a custom rule configuration file to include only the rules you want or exclude the rules
you don't want.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: ReviewUnusedParameter

## Description

This rule detects parameters that are declared but not used a script, scriptblock, or function
This rule detects parameters that are declared but not used in a script, scriptblock, or function
scope. You should consider removing unused parameters to improve code clarity and reduce confusion
about your function's dependencies.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ configuration:
@{
'Rules' = @{
'PSUseCompatibleCmdlets' = @{
'Compatibility' = @('core-6.1.0-windows')
'compatibility' = @('core-6.1.0-windows')
}
}
}
```

The **Compatibility** parameter accepts a list of one or more target identifiers, such as:
The **compatibility** parameter accepts a list of one or more target identifiers, such as:

- desktop-2.0-windows
- desktop-3.0-windows
Expand All @@ -56,7 +56,7 @@ minor version profiles.

You can also create a custom profile with [New-CommandDataFile.ps1][01]. Place the generated JSON
file in the `Settings` folder of the `PSScriptAnalyzer` module. Then you can reference that file by
name under `Compatibility`.
name under `compatibility`.

The `core-6.0.2-*` files were removed in PSScriptAnalyzer 1.18 because PowerShell 6.0 reached its
end of life.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: UseCompatibleCommands

This rule detects commands that aren't available on your targeted PowerShell platform.

A name in the PowerShell platform is identified in the following format:
PowerShell platform names use the following format:

```
<os-name>_<os-arch>_<os-version>_<ps-version>_<ps-arch>_<dotnet-version>_<dotnet-edition>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: UseCompatibleTypes

This rule detects types that aren't available by default on your targeted PowerShell platforms.

A name in the PowerShell platform is identified in the following format:
PowerShell platform names use the following format:

```
<os-name>_<os-arch>_<os-version>_<ps-version>_<ps-arch>_<dotnet-version>_<dotnet-edition>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ following entries:
- `VariablesToExport`

When you use wildcards or null, PowerShell performs expensive analysis of your module during
autodiscovery. Instead, use an explicit list of items to export.
autodiscovery. Instead, use an explicit list of items to export. If you have no items to export, use
an empty array (`@()`) instead of null or a wildcard.

## Example

Expand Down
Loading