PowerShell / PowerShell/PSScriptAnalyzer
Should Script Analyzer deal with binary modules?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Here's a thought that just came to mind while discussing pluralized nouns in more Azure cmdlets with another MVP:
If a module author creates a binary module with cmdlets that have pluralized nouns, I think (haven't specifically tested these scenarios myself) they can package that up in a module in one of two lazy ways:
- Drop the dll into a folder with the same name as the dll (minus the extension), and voila, it's auto-discoverable via PowerShell if it's in the right path.
- Drop the dll into a folder with the same name as the dll, along with a manifest with the same name so that you get versioning, have the manifest load the binary module, but leave the default '*' values for all Export_whatever_ manifest attributes so that all cmdlets are exported.
In both of these scenarios, there is nothing that PSScriptAnalyzer can do to flag issues like pluralized nouns or non-standard verbs, is there? Does PSScriptAnalyzer even check a manifest for pluralized nouns in the exported command names, if they are listed?
I started thinking about this because I was wondering how/why so many pluralized nouns were getting included in released modules from the AzureRM group, and if they use binary cmdlets, this may be one of the reasons why. I'm looking forward to PSScriptAnalyzer evolving into simply PSAnalyzer or perhaps adopting a PSModuleAnalyzer sibling that can check for these types of issues, either by loading modules as part of the inspection or, preferably, by inspecting with reflection or other means the contents of binary modules for issues with command naming and attribute use.
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
Es wird keine Datei, kein Test und kein Einstiegspunkt genannt. Beginne damit zu prüfen, wie PSScriptAnalyzer derzeit mit Modulen und Manifesten umgeht, und ermittle anschließend, ob Befehlsnamen von Binärmodulen untersucht werden können; als abgeschlossen kann die Aufgabe erst gelten, wenn ein festgelegter Umfang für die Erkennung von Nomen im Plural und nicht standardmäßigen Verben vorliegt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, powershell
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100