PowerShell / PowerShell/PSScriptAnalyzer
Documentation for implementing rules in a .NET assembly
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Apologies if I've just missed something, but I can't seem to find much in the way of documentation for implementing rules in a .NET assembly. I took a stab at it anyway by creating a class that implements IScriptRule, but ScriptAnalyzer can't seem to find it. I just get something like:
Invoke-ScriptAnalyzer : Exception of type 'System.Exception' was thrown.
At line:1 char:1
+ Invoke-ScriptAnalyzer -Path C:\local\test.ps1 -Cu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (Microsoft.Windo....ScriptAnalyzer:ScriptAnalyzer) [Invoke-ScriptAnalyzer], Exception
+ FullyQualifiedErrorId : Cannot find ScriptAnalyzer rules in the specified path,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
I've tried adding an [Export(typeof(IScriptRule))] attribute to my class, but it didn't help.
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 with IScriptRule and the ScriptAnalyzer behavior described in the report, then reproduce the shown Invoke-ScriptAnalyzer failure with the referenced .NET assembly. Determine what assembly and class details documentation must explain, and finish with documentation that lets a user implement and discover a rule successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100