Skip to main content
powershell/PSUseConsistentParametersKind is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

Description

All functions should use the same pattern when defining parameters. Possible pattern types are:
  1. Inline
  2. ParamBlock
In simple scenarios, both function definitions shown are considered to be equal. The purpose of this rule is to enforce consistent code style across the codebase.

How to Fix

Rewrite function so it defines parameters as specified in the rule

Examples

When the rule sets parameters definition kind to Inline:
When the rule sets parameters definition kind to ParamBlock:

Source

This rule documentation is adapted from Microsoft’s PSScriptAnalyzer documentation for UseConsistentParametersKind, licensed under CC BY 4.0.