Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
111 stars 76 forks source link

build-module.ps1 generated incorrect docs for comments in custom ps1 file #1223

Open YanaXu opened 10 months ago

YanaXu commented 10 months ago

Refer to the custom ps1 file src/DevCenter/DevCenter.AutoRest/custom/New-AzDevCenterAdminPool.ps1. The parameter definitions in custom ps1 are:

        # Feature in preview, uncomment when available
        # [Parameter(ParameterSetName = 'CreateExpanded')]
        # [Parameter(ParameterSetName = 'CreateViaIdentityExpanded')]
        # [Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Category('Body')]
        # [System.Int32]
        # # The specified time in minutes to wait before stopping a Dev Box once disconnect is detected.
        # ${StopOnDisconnectGracePeriodMinute},

        # [Parameter(ParameterSetName = 'CreateExpanded')]
        # [Parameter(ParameterSetName = 'CreateViaIdentityExpanded')]
        # [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Support.StopOnDisconnectEnableStatus])]
        # [Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Category('Body')]
        # [Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Support.StopOnDisconnectEnableStatus]
        # # Whether the feature to stop the Dev Box on disconnect once the grace period has lapsed is enabled.
        # ${StopOnDisconnectStatus},

        [Parameter(ParameterSetName = 'CreateExpanded')]
        [Parameter(ParameterSetName = 'CreateViaIdentityExpanded')]
        [Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Category('Body')]
        [Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Models.Api30.ITrackedResourceTags]))]
        [System.Collections.Hashtable]
        # Resource tags.
        ${Tag},

After running build-module.ps1, it generates src/DevCenter/DevCenter.AutoRest/docs/New-AzDevCenterAdminPool.md

### -Tag
[Parameter(ParameterSetName = 'CreateExpanded')]
[Parameter(ParameterSetName = 'CreateViaIdentityExpanded')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Support.StopOnDisconnectEnableStatus])]
[Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.DevCenter.Support.StopOnDisconnectEnableStatus]
# Whether the feature to stop the Dev Box on disconnect once the grace period has lapsed is enabled.
${StopOnDisconnectStatus},
Resource tags.

It should be

### -Tag
Resource tags.

This issue can be workarounded by an empty line in this PR.