◐ Shell
clean mode source ↗

Add UseConsistentParametersKind rule by Haimasker · Pull Request #2149 · PowerShell/PSScriptAnalyzer

Conversation

@Haimasker

  • Consistent function parameters definition

  • Rule is disabled by default

  • Possible types of preferred function parameters are: "Inline", "ParamBlock"

PR Summary

This PSScriptAnalyzer rule enforces uniform parameter definitions ("Inline" or "ParamBlock") across functions, improving code readability and maintainability.

Key Benefits:

  1. Consistency: Standardizes parameter style project-wide, making code easier to read and extend.
  2. Advanced Attributes: param block provides CmdletBinding(), OutputType(), and other advanced attributes. On the other hand, these attributes can be blocked by using inline parameters.

PR Checklist

@Haimasker

@microsoft-github-policy-service agree

@Haimasker

bergmeister

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution and sorry for late review. I added Andy as well as he is the main code owner.
The rule might be a bit controversial as for some folks there is no 'correct' kind, therefore I suggest to name rule UseConsistentParametersKind for consistency with other rule names

@Haimasker Haimasker changed the title Add UseCorrectParametersKind rule Add UseConsistentParametersKind rule

Feb 14, 2026
* Consistent function parameters definition

* Rule is disabled by default

* Possible types of preferred function parameters are: "Inline",
"ParamBlock"

bergmeister

@Haimasker

@bergmeister

@Haimasker Already pinged @andyleejordan internally a couple weeks ago as he is main maintainer, it's on his list, please be patient.

andyleejordan

@andyleejordan