PowerShell / PowerShell/PSScriptAnalyzer
UseCompatibleCommands should recognise partial parameter matches
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Summary of the new feature
PowerShell allows for the usage of partial parameter names, like Import-Module 'MyModule' -Pass.
UseCompatibleCommands currently sees this is a compatibility error.
While PSScriptAnalyzer should discourage truncated parameter names (like command aliases), UseCompatibleCommands should be able to recognise the difference between a truncated parameter that will work and something that will not.
Proposed technical implementation details (optional)
The query API currently uses a dictionary to look up parameters. Instead of this, it should lazily compute a trie of parameters that is able to tell whether a parameter is uniquely resolved given an input.
What is the latest version of PSScriptAnalyzer at the point of writing
1.18.0
/cc @JamesWTruher
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing UseCompatibleCommands and its query API to find the current dictionary-based parameter lookup. Check how partial PowerShell parameter names are classified, then verify behavior for uniquely resolved and ambiguous or invalid truncations. Done means valid partial matches are accepted without weakening the analyzer's existing compatibility checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100