PowerShell / PowerShell/PSScriptAnalyzer
Parameter Help auto generation in PowerShell Functions
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
Summary
If you go above the parameter block of a function and write "##" the parameter help template is pre-generated automatically by the PowerShell Extension. However currently this generates:
<#
.SYNOPSIS
Short description
.DESCRIPTION
Long description
.PARAMETER exampleParam
Parameter description
.EXAMPLE
An example
.NOTES
General notes
#>
However, it is best practice to also specify the return value of your function by using ".OUTPUTS", therefore it would be nice if this could be added to the default template / if the default template could be configured in the settings.json.
Proposed Design
This could be accomplished by either:
Static Design
Add ".OUTPUTS" to the current template
Dynamic Design
Add the possibility to specify the fields in the template in a list like:
"powershell.extentention" : {
"parameterHelp" : {
"generatorTemplateFields" : [
".SYNOPSIS", ".DESCRIPTION", ".PARAMETER", ".EXAMPLE", ".NOTES", ".OUTPUTS"
]
}
}
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
No files or tests are named. Start by locating the parameter-help generator and the settings definitions for the PowerShell extension, then compare the existing template with the proposed .OUTPUTS field and generatorTemplateFields setting. Done means either adding .OUTPUTS to the generated help or documenting and implementing configurable template fields, with coverage for the selected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100