New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment Based help breaks the default Syntax in help #3006

Open
DarqueWarrior opened this Issue Jan 16, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@DarqueWarrior
Contributor

DarqueWarrior commented Jan 16, 2017

Steps to reproduce

I created an advanced function with a lot of parameters including a dynamic parameter (ProjectName) and some with the ValidateSet attribute. When I run Help Get-Build before adding comment based help I get the Syntax below.

Expected behavior

NAME
    Get-Build

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

    Get-Build [-ProjectName] <string> [-id <int[]>]  [<CommonParameters>]


ALIASES
    None


REMARKS
    None

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

Actual behavior

NAME
    Get-Build

SYNOPSIS
    Gets the builds for a team project.


SYNTAX
    Get-Build [-top <Int32>] [-resultFilter <String>] [-reasonFilter <String>] [-statusFilter <String>] [-queues
    <Int32[]>] [-definitions <Int32[]>] [-buildNumber <String>] [-type <String>] [-maxBuildsPerDefinition <Int32>]
    [-properties <String[]>] [<CommonParameters>]

    Get-Build [-id <Int32[]>] [<CommonParameters>]


DESCRIPTION
    The Get-Build function gets the builds for a team project. The project name
    is a Dynamic Parameter which may not be displayed in the syntax above but is
    mandatory.

    With just a project name, this function gets all of the builds for that team
    project. You can also specify a particular build by ID.


RELATED LINKS
    Add-TeamAccount
    Set-DefaultProject
    Add-Build
    Remove-Build

REMARKS
    To see the examples, type: "get-help Get-Build -examples".
    For more information, type: "get-help Get-Build -detailed".
    For technical information, type: "get-help Get-Build -full".
    For online help, type: "get-help Get-Build -online"

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?

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
GitCommitId                    v6.0.0-alpha.14
SerializationVersion           1.1.0.1
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
BuildVersion                   3.0.0.0
PSEdition                      Core
WSManStackVersion              3.0
CLRVersion
@LethiferousMoose

This comment has been minimized.

Show comment
Hide comment
@LethiferousMoose

LethiferousMoose Oct 27, 2017

Any updates on this? I just came across this issue this week on version 5.1. I cannot use comment based help with dynamic parameters, because the comment based help ends up removing the help message for dynamic parameters.

LethiferousMoose commented Oct 27, 2017

Any updates on this? I just came across this issue this week on version 5.1. I cannot use comment based help with dynamic parameters, because the comment based help ends up removing the help message for dynamic parameters.

@SteveL-MSFT SteveL-MSFT added this to the 6.1.0 milestone Nov 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment