Skip to content

Commit 2678cf8

Browse files
Fixes about_Parameter_Sets
1 parent 479dd09 commit 2678cf8

4 files changed

Lines changed: 56 additions & 40 deletions

File tree

reference/5.1/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ The following requirements apply to all parameter sets.
3333
unique positions for each parameter. No two positional parameters can specify
3434
the same position.
3535

36-
- Only one parameter in a set can declare the `ValueFromPipeline` keyword with
37-
a value of `true`. Multiple parameters can define the
38-
`ValueFromPipelineByPropertyName` keyword with a value of `true`.
39-
4036
> [!NOTE]
4137
> There is a limit of 32 parameter sets.
4238
@@ -69,12 +65,20 @@ parameter sets.
6965
PowerShell reserves the parameter set name `__AllParameterSets` for special
7066
handling.
7167

72-
- This name is the default name of the parameter set that when you don't
73-
explicitly define a parameter set name.
74-
- When you have muliple parameter sets, you can use this name to define a
75-
parameter that belongs to all parameter sets.
76-
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
77-
`[CmdletBinding()]` attribute has no effect.
68+
`__AllParameterSets` is the name of the default parameter set when an explicit
69+
default name is not used.
70+
71+
Setting the `ParameterSetName` of a the **Parameter** attribute to
72+
`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both
73+
cases the parameter belongs to all parameter sets.
74+
75+
> [!NOTE]
76+
> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`.
77+
78+
The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be
79+
explicitly set to `__AllParameterSets`. This is not recommended as it causes
80+
creation of an explicit parameter set which cannot be properly referenced by the
81+
**Parameter** attribute.
7882

7983
## Examples
8084

reference/7.4/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ The following requirements apply to all parameter sets.
3333
unique positions for each parameter. No two positional parameters can specify
3434
the same position.
3535

36-
- Only one parameter in a set can declare the `ValueFromPipeline` keyword with
37-
a value of `true`. Multiple parameters can define the
38-
`ValueFromPipelineByPropertyName` keyword with a value of `true`.
39-
4036
> [!NOTE]
4137
> There is a limit of 32 parameter sets.
4238
@@ -69,12 +65,20 @@ parameter sets.
6965
PowerShell reserves the parameter set name `__AllParameterSets` for special
7066
handling.
7167

72-
- This name is the default name of the parameter set that when you don't
73-
explicitly define a parameter set name.
74-
- When you have muliple parameter sets, you can use this name to define a
75-
parameter that belongs to all parameter sets.
76-
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
77-
`[CmdletBinding()]` attribute has no effect.
68+
`__AllParameterSets` is the name of the default parameter set when an explicit
69+
default name is not used.
70+
71+
Setting the `ParameterSetName` of a the **Parameter** attribute to
72+
`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both
73+
cases the parameter belongs to all parameter sets.
74+
75+
> [!NOTE]
76+
> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`.
77+
78+
The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be
79+
explicitly set to `__AllParameterSets`. This is not recommended as it causes
80+
creation of an explicit parameter set which cannot be properly referenced by the
81+
**Parameter** attribute.
7882

7983
## Examples
8084

reference/7.5/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ The following requirements apply to all parameter sets.
3333
unique positions for each parameter. No two positional parameters can specify
3434
the same position.
3535

36-
- Only one parameter in a set can declare the `ValueFromPipeline` keyword with
37-
a value of `true`. Multiple parameters can define the
38-
`ValueFromPipelineByPropertyName` keyword with a value of `true`.
39-
4036
> [!NOTE]
4137
> There is a limit of 32 parameter sets.
4238
@@ -69,12 +65,20 @@ parameter sets.
6965
PowerShell reserves the parameter set name `__AllParameterSets` for special
7066
handling.
7167

72-
- This name is the default name of the parameter set that when you don't
73-
explicitly define a parameter set name.
74-
- When you have muliple parameter sets, you can use this name to define a
75-
parameter that belongs to all parameter sets.
76-
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
77-
`[CmdletBinding()]` attribute has no effect.
68+
`__AllParameterSets` is the name of the default parameter set when an explicit
69+
default name is not used.
70+
71+
Setting the `ParameterSetName` of a the **Parameter** attribute to
72+
`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both
73+
cases the parameter belongs to all parameter sets.
74+
75+
> [!NOTE]
76+
> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`.
77+
78+
The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be
79+
explicitly set to `__AllParameterSets`. This is not recommended as it causes
80+
creation of an explicit parameter set which cannot be properly referenced by the
81+
**Parameter** attribute.
7882

7983
## Examples
8084

reference/7.6/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ The following requirements apply to all parameter sets.
3333
unique positions for each parameter. No two positional parameters can specify
3434
the same position.
3535

36-
- Only one parameter in a set can declare the `ValueFromPipeline` keyword with
37-
a value of `true`. Multiple parameters can define the
38-
`ValueFromPipelineByPropertyName` keyword with a value of `true`.
39-
4036
> [!NOTE]
4137
> There is a limit of 32 parameter sets.
4238
@@ -69,12 +65,20 @@ parameter sets.
6965
PowerShell reserves the parameter set name `__AllParameterSets` for special
7066
handling.
7167

72-
- This name is the default name of the parameter set that when you don't
73-
explicitly define a parameter set name.
74-
- When you have muliple parameter sets, you can use this name to define a
75-
parameter that belongs to all parameter sets.
76-
- Setting **DefaultParameterSetName** to `__AllParameterSets` in the
77-
`[CmdletBinding()]` attribute has no effect.
68+
`__AllParameterSets` is the name of the default parameter set when an explicit
69+
default name is not used.
70+
71+
Setting the `ParameterSetName` of a the **Parameter** attribute to
72+
`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both
73+
cases the parameter belongs to all parameter sets.
74+
75+
> [!NOTE]
76+
> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`.
77+
78+
The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be
79+
explicitly set to `__AllParameterSets`. This is not recommended as it causes
80+
creation of an explicit parameter set which cannot be properly referenced by the
81+
**Parameter** attribute.
7882

7983
## Examples
8084

0 commit comments

Comments
 (0)