Author Posts

January 13, 2017 at 2:16 am

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?

January 13, 2017 at 3:28 am

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