platyPS
                                
                                 platyPS copied to clipboard
                                
                                    platyPS copied to clipboard
                            
                            
                            
                        Mandatory parameters are generated inconsistently
Steps to reproduce
I have two function signatures, like so:
function Function1 {
  [CmdletBinding()]
  [OutputType([Void])]
  Param(
    [Parameter(Mandatory)][String] $Csv,
    [Parameter(Mandatory)][String][ValidateSet('Google')] $Target,
    [Parameter(Mandatory)][String] $TargetKey,
    [Parameter()][Switch] $DryRun = $false,
    [Parameter()][String][ValidateSet('None', 'Normal', 'Detailed', 'Diagnostic')] $Verbosity = 'Detailed'
  )
function Function2 {
  [CmdletBinding()]
  [OutputType([Void])]
  Param(
    [Parameter(Mandatory)][String] $Csv,
    [Parameter(Mandatory)][String][ValidateSet('Google')] $Target,
    [Parameter(Mandatory)][String] $TargetKey,
    [Parameter()][Switch] $ServerSide = $false,
    [Parameter()][Switch] $DryRun = $false,
    [Parameter()][String][ValidateSet('None', 'Normal', 'Detailed', 'Diagnostic')] $Verbosity = 'Detailed'
  )
The generated syntax looks like this:
Function1 [-Csv] <String> [-Target] <String> [-TargetKey] <String> [-DryRun]
 [[-Verbosity] <String>] [<CommonParameters>]
Function2 [-Csv] <String> -Target <String> [-TargetKey] <String> [-ServerSide] [-DryRun]
 [[-Verbosity] <String>] [<CommonParameters>]
Expected behavior
I expect them to be the same. Since I don't have positions specified, I would think the second example is correct, but that would make other parameters like $TargetKey wrong, too.
Actual behavior
As shown above.
Environment data
v0.14.0
@chscott, thanks for reporting this issue. We were not able to reproduce your results with 0.14.1 and our newer preview of 2.0.0. Can you upgrade to 0.14.1 and let me know if you get the same results?
Not able to reproduce the issue shown.