Skip to content

Instantly share code, notes, and snippets.

@gerane
Last active July 1, 2016 19:57
Show Gist options
  • Save gerane/5c37aad3d18c1f81bb6a2b3dfcd6f245 to your computer and use it in GitHub Desktop.
Save gerane/5c37aad3d18c1f81bb6a2b3dfcd6f245 to your computer and use it in GitHub Desktop.
I add

-ExtensionName

The Extensions Name. Accepts WildCards.

Type: String[]
Parameter Sets: ExtensionName
Aliases: 

Required: True
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: True

-Category

Filter Extensions by Categories. Valid categoies are 'Languages', 'Snippets', 'Linters', 'Debuggers', 'Other', 'Themes' and 'Productivity'

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False

-Test

{{Fill Test Description}}

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False
[CmdletBinding(DefaultParameterSetName="ExtensionName")]
[OutputType([PSCustomObject])]
param
(
[Parameter(ParameterSetName="ExtensionName",Mandatory=$true,ValueFromPipelineByPropertyName=$false,Position=0)]
[SupportsWildcards()]
[PSDefaultValue(Help='*')]
[string[]]$ExtensionName = '*',
[Parameter(ParameterSetName="DisplayName",Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
[string[]]$DisplayName,
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,Position=1)]
[string[]]$PublisherName,
[Parameter(Mandatory=$false)]
[ValidateSet('Languages','Snippets','Linters','Debuggers','Other','Themes','Productivity')]
[SupportsWildcards()]
[string[]]$Category,
[Parameter(Mandatory=$false)]
[string[]]$Tag,
[Parameter(Mandatory=$false)]
[ValidateSet('Languages','Snippets','Linters','Debuggers','Other','Themes','Productivity')]
[SupportsWildcards()]
[string[]]$Test
)

-ExtensionName

The Extensions Name. Accepts WildCards.

Type: String[]
Parameter Sets: ExtensionName
Aliases: 

Required: True
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: True

-Category

Filter Extensions by Categories. Valid categoies are 'Languages', 'Snippets', 'Linters', 'Debuggers', 'Other', 'Themes' and 'Productivity'

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False

-Test

{{Fill Test Description}}

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False
[CmdletBinding(DefaultParameterSetName="ExtensionName")]
[OutputType([PSCustomObject])]
param
(
[Parameter(ParameterSetName="ExtensionName",Mandatory=$true,ValueFromPipelineByPropertyName=$false,Position=0)]
[SupportsWildcards()]
[PSDefaultValue(Help='*')]
[string[]]$ExtensionName = '*',
[Parameter(ParameterSetName="DisplayName",Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
[string[]]$DisplayName,
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,Position=1)]
[string[]]$PublisherName,
[Parameter(Mandatory=$false)]
[ValidateSet('Languages','Snippets','Linters','Debuggers','Other','Themes','Productivity')]
[SupportsWildcards()]
[string[]]$Category,
[Parameter(Mandatory=$false)]
[string[]]$Tag
)

Before Params

I added the following changes but the help doesn't see them as changes. Ran update 10 or so times.

  • $Category
    • [SupportsWildcards()]
  • $ExtensionName
    • [SupportsWildcards()]
    • [PSDefaultValue(Help='*')]
    • ValueFromPipelineByPropertyName=$false (Value was True)

After Params

I then added a new Param named Test. This acutally registered a change and the next update added the new parameter, but it ignored all changes except the ValueFromPipelineByPropertyName=$false

  • $Test
    • [Parameter(Mandatory=$false)]
    • [ValidateSet('Languages','Snippets','Linters','Debuggers','Other','Themes','Productivity')]
    • [SupportsWildcards()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment