diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidOverwritingBuiltInCmdlets.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidOverwritingBuiltInCmdlets.md index a60ef41..8bd9c0f 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidOverwritingBuiltInCmdlets.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidOverwritingBuiltInCmdlets.md @@ -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 diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/MissingModuleManifestField.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/MissingModuleManifestField.md index 0b50edf..835ff62 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/MissingModuleManifestField.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/MissingModuleManifestField.md @@ -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` diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md index 2d96944..b06c760 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/README.md @@ -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. diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/ReviewUnusedParameter.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/ReviewUnusedParameter.md index abc5357..bbe5adb 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/ReviewUnusedParameter.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/ReviewUnusedParameter.md @@ -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. diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCmdlets.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCmdlets.md index cc339f0..afe3c72 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCmdlets.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCmdlets.md @@ -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 @@ -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. diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCommands.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCommands.md index e5c72b6..0624a19 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCommands.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleCommands.md @@ -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: ``` ______ diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleTypes.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleTypes.md index dc98ecd..e50822d 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleTypes.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseCompatibleTypes.md @@ -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: ``` ______ diff --git a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseToExportFieldsInManifest.md b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseToExportFieldsInManifest.md index 1d5038c..3dfe435 100644 --- a/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseToExportFieldsInManifest.md +++ b/reference/docs-conceptual/PSScriptAnalyzer/Rules/UseToExportFieldsInManifest.md @@ -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