PowerShell / PowerShell/PSScriptAnalyzer

Enable enforcing consistent casing

Open
#1,332 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Formatter Issue - Enhancement Up-for-Grabs
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

Summary of the new feature

PowerShell code used in official examples and VS Code code generation seems to follow some basic casing conventions:

  • PascalCase for
    • cmdlets
    • parameters
    • constants
  • lowercase for
    • operators
    • statements (if, foreach, etc)
  • camelCase for
    • local variables
  • casing of module names and .NET types, enum values, etc consistent with their original case-sensitive casing

I would like to optionally enforce these casing conventions with PSScriptAnalyzer.

Proposed technical implementation details (optional)

I would like to enable rules in my PSScriptAnalyzerSettings.psd1 that enforce the casing rules above and autofix casing issues.

What is the latest version of PSScriptAnalyzer at the point of writing
1.18.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue's proposed casing conventions and how PSScriptAnalyzer settings enable rules. Done should include optional enforcement for the listed casing categories and autofix support, with behavior for original-case module names and .NET types defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.