From 2678cf8f1f586890457b31a77225bb180aa72f68 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 9 Apr 2025 21:07:35 +0100 Subject: [PATCH 1/3] Fixes about_Parameter_Sets --- .../About/about_Parameter_Sets.md | 24 +++++++++++-------- .../About/about_Parameter_Sets.md | 24 +++++++++++-------- .../About/about_Parameter_Sets.md | 24 +++++++++++-------- .../About/about_Parameter_Sets.md | 24 +++++++++++-------- 4 files changed, 56 insertions(+), 40 deletions(-) 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 b11ed8d1bdce..ae510535d8bb 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 @@ -33,10 +33,6 @@ The following requirements apply to all parameter sets. unique positions for each parameter. No two positional parameters can specify the same position. -- Only one parameter in a set can declare the `ValueFromPipeline` keyword with - a value of `true`. Multiple parameters can define the - `ValueFromPipelineByPropertyName` keyword with a value of `true`. - > [!NOTE] > There is a limit of 32 parameter sets. @@ -69,12 +65,20 @@ parameter sets. 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. +`__AllParameterSets` is the name of the default parameter set when an explicit +default name is not used. + +Setting the `ParameterSetName` of a the **Parameter** attribute to +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both +cases the parameter belongs to all parameter sets. + +> [!NOTE] +> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. + +The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be +explicitly set to `__AllParameterSets`. This is not recommended as it causes +creation of an explicit parameter set which cannot be properly referenced by the +**Parameter** attribute. ## Examples 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 861f4859b251..41588ba40bb7 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 @@ -33,10 +33,6 @@ The following requirements apply to all parameter sets. unique positions for each parameter. No two positional parameters can specify the same position. -- Only one parameter in a set can declare the `ValueFromPipeline` keyword with - a value of `true`. Multiple parameters can define the - `ValueFromPipelineByPropertyName` keyword with a value of `true`. - > [!NOTE] > There is a limit of 32 parameter sets. @@ -69,12 +65,20 @@ parameter sets. 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. +`__AllParameterSets` is the name of the default parameter set when an explicit +default name is not used. + +Setting the `ParameterSetName` of a the **Parameter** attribute to +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both +cases the parameter belongs to all parameter sets. + +> [!NOTE] +> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. + +The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be +explicitly set to `__AllParameterSets`. This is not recommended as it causes +creation of an explicit parameter set which cannot be properly referenced by the +**Parameter** attribute. ## Examples 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 cfbd15ffd8e6..a006ce67504d 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 @@ -33,10 +33,6 @@ The following requirements apply to all parameter sets. unique positions for each parameter. No two positional parameters can specify the same position. -- Only one parameter in a set can declare the `ValueFromPipeline` keyword with - a value of `true`. Multiple parameters can define the - `ValueFromPipelineByPropertyName` keyword with a value of `true`. - > [!NOTE] > There is a limit of 32 parameter sets. @@ -69,12 +65,20 @@ parameter sets. 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. +`__AllParameterSets` is the name of the default parameter set when an explicit +default name is not used. + +Setting the `ParameterSetName` of a the **Parameter** attribute to +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both +cases the parameter belongs to all parameter sets. + +> [!NOTE] +> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. + +The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be +explicitly set to `__AllParameterSets`. This is not recommended as it causes +creation of an explicit parameter set which cannot be properly referenced by the +**Parameter** attribute. ## Examples 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 b6469444b627..8cfffcb5a85d 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 @@ -33,10 +33,6 @@ The following requirements apply to all parameter sets. unique positions for each parameter. No two positional parameters can specify the same position. -- Only one parameter in a set can declare the `ValueFromPipeline` keyword with - a value of `true`. Multiple parameters can define the - `ValueFromPipelineByPropertyName` keyword with a value of `true`. - > [!NOTE] > There is a limit of 32 parameter sets. @@ -69,12 +65,20 @@ parameter sets. 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. +`__AllParameterSets` is the name of the default parameter set when an explicit +default name is not used. + +Setting the `ParameterSetName` of a the **Parameter** attribute to +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both +cases the parameter belongs to all parameter sets. + +> [!NOTE] +> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. + +The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be +explicitly set to `__AllParameterSets`. This is not recommended as it causes +creation of an explicit parameter set which cannot be properly referenced by the +**Parameter** attribute. ## Examples From 49e42d87fcadfb90a14bc1990d63d70295fe1536 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 9 Apr 2025 16:29:21 -0700 Subject: [PATCH 2/3] Clarify `DefaultParameterSetName` usage in documentation --- .../About/about_Parameter_Sets.md | 10 ++++------ .../About/about_Parameter_Sets.md | 10 ++++------ .../About/about_Parameter_Sets.md | 10 ++++------ .../About/about_Parameter_Sets.md | 10 ++++------ 4 files changed, 16 insertions(+), 24 deletions(-) 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 ae510535d8bb..ef1adfc4ae47 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 @@ -73,12 +73,10 @@ Setting the `ParameterSetName` of a the **Parameter** attribute to cases the parameter belongs to all parameter sets. > [!NOTE] -> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. - -The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be -explicitly set to `__AllParameterSets`. This is not recommended as it causes -creation of an explicit parameter set which cannot be properly referenced by the -**Parameter** attribute. +> The **CmdletBinding** attribute doesn't prevent you from setting the +> `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, +> PowerShell creates an explicit parameter set that can't be properly +> referenced by the **Parameter** attribute. ## Examples 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 41588ba40bb7..b3cdb04213e3 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 @@ -73,12 +73,10 @@ Setting the `ParameterSetName` of a the **Parameter** attribute to cases the parameter belongs to all parameter sets. > [!NOTE] -> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. - -The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be -explicitly set to `__AllParameterSets`. This is not recommended as it causes -creation of an explicit parameter set which cannot be properly referenced by the -**Parameter** attribute. +> The **CmdletBinding** attribute doesn't prevent you from setting the +> `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, +> PowerShell creates an explicit parameter set that can't be properly +> referenced by the **Parameter** attribute. ## Examples 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 a006ce67504d..022ffc2ade27 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 @@ -73,12 +73,10 @@ Setting the `ParameterSetName` of a the **Parameter** attribute to cases the parameter belongs to all parameter sets. > [!NOTE] -> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. - -The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be -explicitly set to `__AllParameterSets`. This is not recommended as it causes -creation of an explicit parameter set which cannot be properly referenced by the -**Parameter** attribute. +> The **CmdletBinding** attribute doesn't prevent you from setting the +> `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, +> PowerShell creates an explicit parameter set that can't be properly +> referenced by the **Parameter** attribute. ## Examples 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 8cfffcb5a85d..a6f67f1a1850 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 @@ -73,12 +73,10 @@ Setting the `ParameterSetName` of a the **Parameter** attribute to cases the parameter belongs to all parameter sets. > [!NOTE] -> `DefaultParameterSetName` should not be explicitly set to `__AllParameterSets`. - -The **CmdletBinding** attribute allows the `DefaultParameterSetName` to be -explicitly set to `__AllParameterSets`. This is not recommended as it causes -creation of an explicit parameter set which cannot be properly referenced by the -**Parameter** attribute. +> The **CmdletBinding** attribute doesn't prevent you from setting the +> `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, +> PowerShell creates an explicit parameter set that can't be properly +> referenced by the **Parameter** attribute. ## Examples From 6715f031a5a2cd4986614253d3fec91a0ff9451f Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 10 Apr 2025 05:19:57 -0700 Subject: [PATCH 3/3] minor edit --- .../Microsoft.PowerShell.Core/About/about_Parameter_Sets.md | 6 +++--- .../Microsoft.PowerShell.Core/About/about_Parameter_Sets.md | 6 +++--- .../Microsoft.PowerShell.Core/About/about_Parameter_Sets.md | 6 +++--- .../Microsoft.PowerShell.Core/About/about_Parameter_Sets.md | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) 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 ef1adfc4ae47..0aabc51c4fb1 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 @@ -69,11 +69,11 @@ handling. default name is not used. Setting the `ParameterSetName` of a the **Parameter** attribute to -`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both -cases the parameter belongs to all parameter sets. +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In +both cases the parameter belongs to all parameter sets. > [!NOTE] -> The **CmdletBinding** attribute doesn't prevent you from setting the +> The **CmdletBinding** attribute doesn't prevent you from setting the > `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, > PowerShell creates an explicit parameter set that can't be properly > referenced by the **Parameter** attribute. 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 b3cdb04213e3..d0e3149f8386 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 @@ -69,11 +69,11 @@ handling. default name is not used. Setting the `ParameterSetName` of a the **Parameter** attribute to -`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both -cases the parameter belongs to all parameter sets. +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In +both cases the parameter belongs to all parameter sets. > [!NOTE] -> The **CmdletBinding** attribute doesn't prevent you from setting the +> The **CmdletBinding** attribute doesn't prevent you from setting the > `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, > PowerShell creates an explicit parameter set that can't be properly > referenced by the **Parameter** attribute. 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 022ffc2ade27..9152b870030e 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 @@ -69,11 +69,11 @@ handling. default name is not used. Setting the `ParameterSetName` of a the **Parameter** attribute to -`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both -cases the parameter belongs to all parameter sets. +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In +both cases the parameter belongs to all parameter sets. > [!NOTE] -> The **CmdletBinding** attribute doesn't prevent you from setting the +> The **CmdletBinding** attribute doesn't prevent you from setting the > `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, > PowerShell creates an explicit parameter set that can't be properly > referenced by the **Parameter** attribute. 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 a6f67f1a1850..7abc47c31570 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 @@ -69,11 +69,11 @@ handling. default name is not used. Setting the `ParameterSetName` of a the **Parameter** attribute to -`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In both -cases the parameter belongs to all parameter sets. +`__AllParameterSets` is equivalent to not assigning a `ParameterSetName`. In +both cases the parameter belongs to all parameter sets. > [!NOTE] -> The **CmdletBinding** attribute doesn't prevent you from setting the +> The **CmdletBinding** attribute doesn't prevent you from setting the > `DefaultParameterSetName` to be to `__AllParameterSets`. If you do this, > PowerShell creates an explicit parameter set that can't be properly > referenced by the **Parameter** attribute.