Skip to content

Syntax diagrams for NON-advanced functions and scripts with comment-based help mistakenly show "[<CommonParameters>]" #17312

@mklement0

Description

@mklement0

Prerequisites

Steps to reproduce

A non-advanced function (or script) by definition doesn't support common parameters.

Yet, if a non-advanced function has comment-based help, its syntax diagram shows [<CommonParameters>] - when invoked via -? or Get-Help (but not with Get-Command -Syntax) - mistakenly suggesting that they are supported:

function Get-Foo { <#.SYNOPSIS #> }; Get-Help Get-Foo

Expected behavior

NAME
    Get-Foo
    
SYNOPSIS
    
    
SYNTAX
    Get-Foo
    
    
DESCRIPTION
    

RELATED LINKS

REMARKS
    To see the examples, type: "Get-Help Get-Foo -Examples"
    For more information, type: "Get-Help Get-Foo -Detailed"
    For technical information, type: "Get-Help Get-Foo -Full"

Actual behavior

NAME
    Get-Foo
    
SYNOPSIS
    
    
SYNTAX
    Get-Foo [<CommonParameters>]
    
    
DESCRIPTION
    

RELATED LINKS

REMARKS
    To see the examples, type: "Get-Help Get-Foo -Examples"
    For more information, type: "Get-Help Get-Foo -Detailed"
    For technical information, type: "Get-Help Get-Foo -Full"

Error details

No response

Environment data

PowerShell Core 7.3.0-preview.3

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions