PowerShell / PowerShell/PSScriptAnalyzer
Improve Usability of PSScriptAnalyzer.psd1
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
Summary of the new feature
According to the docs it's as simple as adding rules to the Rules HashMap in PSScriptAnalyzer.psd1:
PSScriptAnalyzer.psd1
@{
Rules = @{
'PSAvoidUsingCmdletAliases' = @{
'allowlist' = @('cd', 'cls', 'copy', 'cp'')
}
}
# Author of this module
Author = 'Microsoft Corporation'
...
Followed by running:
Import-Module PSScriptAnalyzer
However, in practice this does not work at all:
Import-Module: The '...\ms-vscode.powershell-2025.0.0\modules\PSScriptAnalyzer\1.23.0\PSScriptAnalyzer.psd1' module cannot be imported because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport', 'DscResourcesToExport', 'CompatiblePSEditions', 'HelpInfoURI', 'RootModule', 'DefaultCommandPrefix').
Remove the members that are not valid ('Rules'), then try to import the module again.
I am sure this is just a beginners mistake and CAN work but it SHOULD JUST work.
Proposed technical implementation details (optional)
A clear and concise description of what you want to happen.
What is the latest version of PSScriptAnalyzer at the point of writing
1.24.0
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 mit PSScriptAnalyzer.psd1 und der in der Issue verlinkten Dokumentation zu AvoidUsingCmdletAliases. Reproduziere den Fehler, indem du das Rules-Mitglied hinzufügst und Import-Module PSScriptAnalyzer ausführst. Fertig ist die Aufgabe, wenn die dokumentierte Regelkonfiguration ohne den Fehler manifest-invalid-members verwendet werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100