PowerShell / PowerShell/PSScriptAnalyzer

Track cmdlet parameter attributes in UseCompatibleCommands, check ValidateSet and enum parameters

Open
#1,152 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Profiles in the compatibility rules currently do not track the attributes on parameters.

If they did this, it could statically check for things like

  • ValidateSet parameters
  • Enum-typed parameters (this is already possible to some extent)
  • Mandatory parameters
  • NotNull parameters

To do this, profiles should record attributes on each parameter. In the case of something like ValidateSet, it should track all the listed possible values for static checking later.

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 locating the compatibility profiles used by UseCompatibleCommands and how parameter information is currently recorded. Determine how ValidateSet values, enum types, mandatory parameters, and NotNull attributes should be represented, then define the static checks that would consume that metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.