Skip to content

Commit d8feba0

Browse files
authored
Add notes about the __AllParameterSets name (#11956)
1 parent ff837e5 commit d8feba0

File tree

4 files changed

+60
-16
lines changed

4 files changed

+60
-16
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how to define and use parameter sets in advanced functions.
33
Locale: en-US
4-
ms.date: 03/27/2024
4+
ms.date: 03/26/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-5.1&WT.mc_id=ps-gethelp
66
title: about_Parameter_Sets
77
---
@@ -64,12 +64,23 @@ one unique parameter.
6464
Parameters that don't have an assigned parameter set name belong to all
6565
parameter sets.
6666

67+
## Reserved parameter set name
68+
69+
PowerShell reserves the parameter set name `__AllParameterSets` for special
70+
handling.
71+
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.
78+
6779
## Examples
6880

6981
The following example function counts the number lines, characters, and words
70-
in a text file. Using parameters, you can specify which values you want
71-
returned and which files you want to measure. There are four parameter sets
72-
defined:
82+
in a text file. Using parameters, you can specify the values you want returned
83+
and the files you want to measure. There are four parameter sets defined:
7384

7485
- Path
7586
- PathAll

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how to define and use parameter sets in advanced functions.
33
Locale: en-US
4-
ms.date: 03/27/2024
4+
ms.date: 03/26/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.4&WT.mc_id=ps-gethelp
66
title: about_Parameter_Sets
77
---
@@ -64,12 +64,23 @@ one unique parameter.
6464
Parameters that don't have an assigned parameter set name belong to all
6565
parameter sets.
6666

67+
## Reserved parameter set name
68+
69+
PowerShell reserves the parameter set name `__AllParameterSets` for special
70+
handling.
71+
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.
78+
6779
## Examples
6880

6981
The following example function counts the number lines, characters, and words
70-
in a text file. Using parameters, you can specify which values you want
71-
returned and which files you want to measure. There are four parameter sets
72-
defined:
82+
in a text file. Using parameters, you can specify the values you want returned
83+
and the files you want to measure. There are four parameter sets defined:
7384

7485
- Path
7586
- PathAll

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how to define and use parameter sets in advanced functions.
33
Locale: en-US
4-
ms.date: 03/27/2024
4+
ms.date: 03/26/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.5&WT.mc_id=ps-gethelp
66
title: about_Parameter_Sets
77
---
@@ -64,12 +64,23 @@ one unique parameter.
6464
Parameters that don't have an assigned parameter set name belong to all
6565
parameter sets.
6666

67+
## Reserved parameter set name
68+
69+
PowerShell reserves the parameter set name `__AllParameterSets` for special
70+
handling.
71+
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.
78+
6779
## Examples
6880

6981
The following example function counts the number lines, characters, and words
70-
in a text file. Using parameters, you can specify which values you want
71-
returned and which files you want to measure. There are four parameter sets
72-
defined:
82+
in a text file. Using parameters, you can specify the values you want returned
83+
and the files you want to measure. There are four parameter sets defined:
7384

7485
- Path
7586
- PathAll

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how to define and use parameter sets in advanced functions.
33
Locale: en-US
4-
ms.date: 03/27/2024
4+
ms.date: 03/26/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.6&WT.mc_id=ps-gethelp
66
title: about_Parameter_Sets
77
---
@@ -64,12 +64,23 @@ one unique parameter.
6464
Parameters that don't have an assigned parameter set name belong to all
6565
parameter sets.
6666

67+
## Reserved parameter set name
68+
69+
PowerShell reserves the parameter set name `__AllParameterSets` for special
70+
handling.
71+
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.
78+
6779
## Examples
6880

6981
The following example function counts the number lines, characters, and words
70-
in a text file. Using parameters, you can specify which values you want
71-
returned and which files you want to measure. There are four parameter sets
72-
defined:
82+
in a text file. Using parameters, you can specify the values you want returned
83+
and the files you want to measure. There are four parameter sets defined:
7384

7485
- Path
7586
- PathAll

0 commit comments

Comments
 (0)