PowerShell / PowerShell/vscode-powershell
Feature Request: Bring Invoke-PSScriptAnalyzer to PowerShell Command Palate
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.9k
- Forks
- 548
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
Summary
For day to day/line by line development the default PSScriptAnalyzer rules in VS Code work well and ensure that it doesn't slow down my development too much. There are however times when I would like to do a more thorough review of the code, for example before publishing remotely or presenting the code to others.
In this scenario, I would like to be able to easily run the full range of tests that PSScriptAnalyzer has without resorting to:
- Modifying the everyday ruleset
- Calling the command line directly
For me (and I suspect others) this would enhance discoverability of this great tool, speed up ad-hoc usage and therefore encourage a much greater usage of the non-realtime rulesets
Proposed Design
When I first attempted to do this I instinctively looked for an option in the PowerShell command list, in the same place as 'Run' and 'Run Pester Tests'

To cater for multiple rulesets my thought process would be to offer the following command structure:
- PowerShell: Run PSScriptAnalyzer
- Default RuleSet (Same as Invoke-PSScriptAnalyser Default RuleSet)
- All Rules (All code and formatting rules)
- Realtime Rules (The ruleset currently configured for real-time analysis)
- Custom (Specify a PSScriptAnalyzer ruleset file)
- Select Location
Brackets/Names are for explanation purposes rather than anticipated naming
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die vorhandenen VS Code-Befehlsimplementierungen für Run und Run Pester Tests zu finden, und verfolge dann, wie die Befehle auf das aktive Skript und die konfigurierten PSScriptAnalyzer-Regeln zugreifen. Als erledigt gilt die Aufgabe, wenn die Befehlspalette Optionen für default, all, realtime und benutzerdefinierte Regelsätze bietet, einschließlich der Auswahl des Speicherorts für den benutzerdefinierten Regelsatz.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell, vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100