Skip to content

Parameter Help auto generation in PowerShell Functions #1931

Open
@fasteiner

Description

@fasteiner

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"
            ]
      }
 }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions