Comment Based help breaks the default Syntax in help

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Donovan Donovan 2 months, 1 week ago.

  • Author
    Posts
  • #61848
    Profile photo of Donovan
    Donovan
    Participant

    I created an advanced function with a lot of parameters including a dynamic parameter (ProjectName) and some with the ValidateSet attribute. Before I add help if I run get help I get the following:

    PS>help Get-Build

    NAME
    Get-Build

    SYNTAX
    Get-Build [-ProjectName] [-top ] [-resultFilter {succeeded | partiallySucceeded | failed | canceled}] [-reasonFilter {manual
    | individualCI | batchedCI | schedule | userCreated | validateShelveset | checkInShelveset | triggered | all}] [-statusFilter {inProgress |
    completed | cancelling | postponed | notStarted | all}] [-queues ] [-definitions ] [-buildNumber ] [-type {build |
    xaml}] [-maxBuildsPerDefinition ] [-properties ] []

    Get-Build [-ProjectName] [-id ] []

    Notice that I can see my dynamic parameter and all the options for my ValidateSet attributes. If I add so much as a .SYNOPSIS and re-run help I get the following:

    PS>help Get-Build

    NAME
    Get-Build

    SYNOPSIS
    Gets the builds for a team project.

    SYNTAX
    Get-Build [-top ] [-resultFilter ] [-reasonFilter ] [-statusFilter ] [-queues ] [-definitions
    ] [-buildNumber ] [-type ] [-maxBuildsPerDefinition ] [-properties ] []

    Get-Build [-id ] []

    Why did the syntax change? I want the original syntax just with my additional help. Is there a way to do that? Can I manually create the Syntax?

  • #61849
    Profile photo of Don Jones
    Don Jones
    Keymaster

    SYNTAX is auto generated. You should log this as a bug; for whatever reason, there are different algorithms for different situations.

  • #62002
    Profile photo of Donovan
    Donovan
    Participant

    Logged. GitHub Issue

You must be logged in to reply to this topic.