diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md index 207072334c26..b11ed8d1bdce 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md @@ -1,7 +1,7 @@ --- description: Describes how to define and use parameter sets in advanced functions. Locale: en-US -ms.date: 03/27/2024 +ms.date: 03/26/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-5.1&WT.mc_id=ps-gethelp title: about_Parameter_Sets --- @@ -64,12 +64,23 @@ one unique parameter. Parameters that don't have an assigned parameter set name belong to all parameter sets. +## Reserved parameter set name + +PowerShell reserves the parameter set name `__AllParameterSets` for special +handling. + +- This name is the default name of the parameter set that when you don't + explicitly define a parameter set name. +- When you have muliple parameter sets, you can use this name to define a + parameter that belongs to all parameter sets. +- Setting **DefaultParameterSetName** to `__AllParameterSets` in the + `[CmdletBinding()]` attribute has no effect. + ## Examples The following example function counts the number lines, characters, and words -in a text file. Using parameters, you can specify which values you want -returned and which files you want to measure. There are four parameter sets -defined: +in a text file. Using parameters, you can specify the values you want returned +and the files you want to measure. There are four parameter sets defined: - Path - PathAll diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md index 4300a63a85be..861f4859b251 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md @@ -1,7 +1,7 @@ --- description: Describes how to define and use parameter sets in advanced functions. Locale: en-US -ms.date: 03/27/2024 +ms.date: 03/26/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.4&WT.mc_id=ps-gethelp title: about_Parameter_Sets --- @@ -64,12 +64,23 @@ one unique parameter. Parameters that don't have an assigned parameter set name belong to all parameter sets. +## Reserved parameter set name + +PowerShell reserves the parameter set name `__AllParameterSets` for special +handling. + +- This name is the default name of the parameter set that when you don't + explicitly define a parameter set name. +- When you have muliple parameter sets, you can use this name to define a + parameter that belongs to all parameter sets. +- Setting **DefaultParameterSetName** to `__AllParameterSets` in the + `[CmdletBinding()]` attribute has no effect. + ## Examples The following example function counts the number lines, characters, and words -in a text file. Using parameters, you can specify which values you want -returned and which files you want to measure. There are four parameter sets -defined: +in a text file. Using parameters, you can specify the values you want returned +and the files you want to measure. There are four parameter sets defined: - Path - PathAll diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md index f50a0626037d..cfbd15ffd8e6 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md @@ -1,7 +1,7 @@ --- description: Describes how to define and use parameter sets in advanced functions. Locale: en-US -ms.date: 03/27/2024 +ms.date: 03/26/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.5&WT.mc_id=ps-gethelp title: about_Parameter_Sets --- @@ -64,12 +64,23 @@ one unique parameter. Parameters that don't have an assigned parameter set name belong to all parameter sets. +## Reserved parameter set name + +PowerShell reserves the parameter set name `__AllParameterSets` for special +handling. + +- This name is the default name of the parameter set that when you don't + explicitly define a parameter set name. +- When you have muliple parameter sets, you can use this name to define a + parameter that belongs to all parameter sets. +- Setting **DefaultParameterSetName** to `__AllParameterSets` in the + `[CmdletBinding()]` attribute has no effect. + ## Examples The following example function counts the number lines, characters, and words -in a text file. Using parameters, you can specify which values you want -returned and which files you want to measure. There are four parameter sets -defined: +in a text file. Using parameters, you can specify the values you want returned +and the files you want to measure. There are four parameter sets defined: - Path - PathAll diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md index 61c42e08ebdd..b6469444b627 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Parameter_Sets.md @@ -1,7 +1,7 @@ --- description: Describes how to define and use parameter sets in advanced functions. Locale: en-US -ms.date: 03/27/2024 +ms.date: 03/26/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameter_sets?view=powershell-7.6&WT.mc_id=ps-gethelp title: about_Parameter_Sets --- @@ -64,12 +64,23 @@ one unique parameter. Parameters that don't have an assigned parameter set name belong to all parameter sets. +## Reserved parameter set name + +PowerShell reserves the parameter set name `__AllParameterSets` for special +handling. + +- This name is the default name of the parameter set that when you don't + explicitly define a parameter set name. +- When you have muliple parameter sets, you can use this name to define a + parameter that belongs to all parameter sets. +- Setting **DefaultParameterSetName** to `__AllParameterSets` in the + `[CmdletBinding()]` attribute has no effect. + ## Examples The following example function counts the number lines, characters, and words -in a text file. Using parameters, you can specify which values you want -returned and which files you want to measure. There are four parameter sets -defined: +in a text file. Using parameters, you can specify the values you want returned +and the files you want to measure. There are four parameter sets defined: - Path - PathAll