diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index a62d8c6dab9b..9f52147f0299 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1,7 +1,7 @@ --- description: Explains how to add parameters to advanced functions. Locale: en-US -ms.date: 01/02/2025 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_Advanced_Parameters @@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of naming rules, see [about_Variables][20]. > [!IMPORTANT] -> It's possible to name a parameter using only decimal digits. Using numeric -> parameter names isn't recommended because it can lead to confusion with -> positional parameters. +> It's possible to define a parameter that starts with a decimal digit. +> Starting parameter names with a digit isn't recommended because PowerShell +> treats them as string values passed as positional parameters. Consider the following example: @@ -58,8 +58,8 @@ function TestFunction { } ``` -If you try to use the parameters, PowerShell interprets them as negative -numbers passed as positional parameter. +If you try to use the parameters, PowerShell interprets them as stings passed +as positional parameter. ```powershell PS> TestFunction -100 -200 Hello @@ -640,6 +640,28 @@ displayed in the `Get-Help -Full` output. This argument has no effect on optional parameters. +#### DontShow argument + +The `DontShow` value is typically used to assist backwards compatibility for a +command where an obsolete parameter cannot be removed. Setting `DontShow` to +`True` hides the parameter from the user for tab expansion and IntelliSense. + +PowerShell v7 (and higher) uses `DontShow` to hide the following obsolete +parameters: + +- The **NoTypeInformation** parameter of `ConvertTo-Csv` and `Export-Csv` +- The **Raw** parameter of `Format-Hex` +- The **UseBasicParsing** parameter of `Invoke-RestMethod` and + `Invoke-WebRequest` + +The `DontShow` argument has the following side effects: + +- Affects all parameter sets for the associated parameter, even if there's a + parameter set in which `DontShow` is unused. +- Hides common parameters from tab completion and IntelliSense. `DontShow` + doesn't hide the optional common parameters: **WhatIf**, **Confirm**, or + **UseTransaction**. + ### Alias attribute The **Alias** attribute establishes an alternate name for the parameter. diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index 26797d7f787a..8d3e6d963782 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 04/30/2024 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -91,7 +91,7 @@ $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() $datetime = Get-Date -f 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = Join-Path -Path $sharepath -ChildPath $filename +$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() Start-Transcript ``` diff --git a/reference/5.1/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md b/reference/5.1/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md index 6b854364a095..0b2dabe8f38b 100644 --- a/reference/5.1/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md +++ b/reference/5.1/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md @@ -2,7 +2,7 @@ external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.LocalAccounts -ms.date: 06/28/2023 +ms.date: 01/04/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.localaccounts/new-localgroup?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-LocalGroup @@ -41,7 +41,7 @@ This command creates a group named SecurityGroup04. ### -Description -Specifies a comment for the group. The maximum length is 48 characters. +Specifies a comment for the group. The maximum length is 256 characters. ```yaml Type: System.String @@ -57,7 +57,7 @@ Accept wildcard characters: False ### -Name -Specifies a name for the group. The maximum length is 256 characters. +Specifies a name for the group. The maximum length is 48 characters. ```yaml Type: System.String diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Write-Information.md b/reference/5.1/Microsoft.PowerShell.Utility/Write-Information.md index a27e8757cf32..837e550e5543 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Write-Information.md @@ -216,12 +216,10 @@ This cmdlet returns no output. It only writes to the information message stream. ## RELATED LINKS -[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) - -[about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) - [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md) +[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) + [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md) [about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) @@ -232,10 +230,10 @@ This cmdlet returns no output. It only writes to the information message stream. [Write-Information](Write-Information.md) +[Write-Output](Write-Output.md) + [Write-Progress](Write-Progress.md) [Write-Verbose](Write-Verbose.md) [Write-Warning](Write-Warning.md) - -[Write-Output](Write-Output.md) diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 1c20e32347b7..dd249ae0fa77 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1,7 +1,7 @@ --- description: Explains how to add parameters to advanced functions. Locale: en-US -ms.date: 01/02/2025 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_Advanced_Parameters @@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of naming rules, see [about_Variables][20]. > [!IMPORTANT] -> It's possible to name a parameter using only decimal digits. Using numeric -> parameter names isn't recommended because it can lead to confusion with -> positional parameters. +> It's possible to define a parameter that starts with a decimal digit. +> Starting parameter names with a digit isn't recommended because PowerShell +> treats them as string values passed as positional parameters. Consider the following example: @@ -58,8 +58,8 @@ function TestFunction { } ``` -If you try to use the parameters, PowerShell interprets them as negative -numbers passed as positional parameter. +If you try to use the parameters, PowerShell interprets them as stings passed +as positional parameter. ```powershell PS> TestFunction -100 -200 Hello @@ -629,6 +629,28 @@ displayed in the `Get-Help -Full` output. This argument has no effect on optional parameters. +#### DontShow argument + +The `DontShow` value is typically used to assist backwards compatibility for a +command where an obsolete parameter cannot be removed. Setting `DontShow` to +`True` hides the parameter from the user for tab expansion and IntelliSense. + +PowerShell v7 (and higher) uses `DontShow` to hide the following obsolete +parameters: + +- The **NoTypeInformation** parameter of `ConvertTo-Csv` and `Export-Csv` +- The **Raw** parameter of `Format-Hex` +- The **UseBasicParsing** parameter of `Invoke-RestMethod` and + `Invoke-WebRequest` + +The `DontShow` argument has the following side effects: + +- Affects all parameter sets for the associated parameter, even if there's a + parameter set in which `DontShow` is unused. +- Hides common parameters from tab completion and IntelliSense. `DontShow` + doesn't hide the optional common parameters: **WhatIf**, **Confirm**, or + **UseTransaction**. + ### Alias attribute The **Alias** attribute establishes an alternate name for the parameter. diff --git a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md index 4b998d051794..775c001aec00 100644 --- a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 04/30/2024 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -92,7 +92,7 @@ $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() $datetime = Get-Date -f 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = Join-Path -Path $sharepath -ChildPath $filename +$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() Start-Transcript ``` @@ -262,8 +262,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet isn't run. +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md index cad2842eae99..65a9e59c0864 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Write-Information.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/19/2023 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-information?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Write-Information @@ -239,12 +239,10 @@ This cmdlet returns no output. It only writes to the information message stream. ## RELATED LINKS -[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) - -[about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) - [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md) +[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) + [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md) [about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) @@ -255,10 +253,10 @@ This cmdlet returns no output. It only writes to the information message stream. [Write-Information](Write-Information.md) +[Write-Output](Write-Output.md) + [Write-Progress](Write-Progress.md) [Write-Verbose](Write-Verbose.md) [Write-Warning](Write-Warning.md) - -[Write-Output](Write-Output.md) diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 686ec5efe2cb..05e04bc46773 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1,7 +1,7 @@ --- description: Explains how to add parameters to advanced functions. Locale: en-US -ms.date: 01/02/2025 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_Advanced_Parameters @@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of naming rules, see [about_Variables][20]. > [!IMPORTANT] -> It's possible to name a parameter using only decimal digits. Using numeric -> parameter names isn't recommended because it can lead to confusion with -> positional parameters. +> It's possible to define a parameter that starts with a decimal digit. +> Starting parameter names with a digit isn't recommended because PowerShell +> treats them as string values passed as positional parameters. Consider the following example: @@ -58,8 +58,8 @@ function TestFunction { } ``` -If you try to use the parameters, PowerShell interprets them as negative -numbers passed as positional parameter. +If you try to use the parameters, PowerShell interprets them as stings passed +as positional parameter. ```powershell PS> TestFunction -100 -200 Hello @@ -629,6 +629,28 @@ displayed in the `Get-Help -Full` output. This argument has no effect on optional parameters. +#### DontShow argument + +The `DontShow` value is typically used to assist backwards compatibility for a +command where an obsolete parameter cannot be removed. Setting `DontShow` to +`True` hides the parameter from the user for tab expansion and IntelliSense. + +PowerShell v7 (and higher) uses `DontShow` to hide the following obsolete +parameters: + +- The **NoTypeInformation** parameter of `ConvertTo-Csv` and `Export-Csv` +- The **Raw** parameter of `Format-Hex` +- The **UseBasicParsing** parameter of `Invoke-RestMethod` and + `Invoke-WebRequest` + +The `DontShow` argument has the following side effects: + +- Affects all parameter sets for the associated parameter, even if there's a + parameter set in which `DontShow` is unused. +- Hides common parameters from tab completion and IntelliSense. `DontShow` + doesn't hide the optional common parameters: **WhatIf**, **Confirm**, or + **UseTransaction**. + ### Alias attribute The **Alias** attribute establishes an alternate name for the parameter. diff --git a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md index d3c2d38fa0a9..0ebbdcda9ff1 100644 --- a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 04/30/2024 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -92,7 +92,7 @@ $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() $datetime = Get-Date -f 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = Join-Path -Path $sharepath -ChildPath $filename +$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() Start-Transcript ``` @@ -262,8 +262,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet isn't run. +Shows what would happen if the cmdlet runs. The cmdlet isn't run. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md b/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md index 9a70fe5288c1..9c2addd64a7f 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Write-Information.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/19/2023 +ms.date: 01/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-information?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Write-Information @@ -239,12 +239,10 @@ This cmdlet returns no output. It only writes to the information message stream. ## RELATED LINKS -[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) - -[about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) - [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md) +[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md) + [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md) [about_Redirection](../Microsoft.PowerShell.Core/About/about_Redirection.md) @@ -255,10 +253,10 @@ This cmdlet returns no output. It only writes to the information message stream. [Write-Information](Write-Information.md) +[Write-Output](Write-Output.md) + [Write-Progress](Write-Progress.md) [Write-Verbose](Write-Verbose.md) [Write-Warning](Write-Warning.md) - -[Write-Output](Write-Output.md) diff --git a/reference/docs-conceptual/developer/cmdlet/parameter-attribute-declaration.md b/reference/docs-conceptual/developer/cmdlet/parameter-attribute-declaration.md index 1efc377bf368..be9113ee8938 100644 --- a/reference/docs-conceptual/developer/cmdlet/parameter-attribute-declaration.md +++ b/reference/docs-conceptual/developer/cmdlet/parameter-attribute-declaration.md @@ -1,6 +1,6 @@ --- description: Parameter Attribute Declaration -ms.date: 09/13/2016 +ms.date: 01/06/2025 ms.topic: reference title: Parameter Attribute Declaration --- @@ -17,48 +17,69 @@ The Parameter attribute identifies a public property of the cmdlet class as a cm #### Parameters -`Mandatory` ([System.Boolean](/dotnet/api/System.Boolean)) -Optional named parameter. `True` indicates the cmdlet parameter is required. If a required parameter is not provided when the cmdlet is invoked, Windows PowerShell prompts the user for a parameter value. The default is `false`. +`Mandatory` ([System.Boolean][03]) Optional named parameter. `True` indicates the cmdlet parameter +is required. If a required parameter is not provided when the cmdlet is invoked, Windows PowerShell +prompts the user for a parameter value. The default is `false`. -`ParameterSetName` ([System.String](/dotnet/api/System.String)) -Optional named parameter. Specifies the parameter set that this cmdlet parameter belongs to. If no parameter set is specified, the parameter belongs to all parameter sets. +`ParameterSetName` ([System.String][06]) Optional named parameter. Specifies the parameter set that +this cmdlet parameter belongs to. If no parameter set is specified, the parameter belongs to all +parameter sets. -`Position` ([System.Int32](/dotnet/api/System.Int32)) -Optional named parameter. Specifies the position of the parameter within a Windows PowerShell command. +`Position` ([System.Int32][04]) Optional named parameter. Specifies the position of the parameter +within a Windows PowerShell command. -`ValueFromPipeline` ([System.Boolean](/dotnet/api/System.Boolean)) -Optional named parameter. `True` indicates that the cmdlet parameter takes its value from a pipeline object. Specify this keyword if the cmdlet accesses the complete object, not just a property of the object. The default is `false`. +`ValueFromPipeline` ([System.Boolean][03]) Optional named parameter. `True` indicates that the +cmdlet parameter takes its value from a pipeline object. Specify this keyword if the cmdlet accesses +the complete object, not just a property of the object. The default is `false`. -`ValueFromPipelineByPropertyName` ([System.Boolean](/dotnet/api/System.Boolean)) -Optional named parameter. `True` indicates that the cmdlet parameter takes its value from a property of a pipeline object that has either the same name or the same alias as this parameter. For example, if the cmdlet has a `Name` parameter and the pipeline object also has a `Name` property, the value of the `Name` property is assigned to the `Name` parameter of the cmdlet. The default is `false`. +`ValueFromPipelineByPropertyName` ([System.Boolean][03]) Optional named parameter. `True` indicates +that the cmdlet parameter takes its value from a property of a pipeline object that has either the +same name or the same alias as this parameter. For example, if the cmdlet has a `Name` parameter and +the pipeline object also has a `Name` property, the value of the `Name` property is assigned to the +`Name` parameter of the cmdlet. The default is `false`. -`ValueFromRemainingArguments` ([System.Boolean](/dotnet/api/System.Boolean)) -Optional named parameter. `True` indicates that the cmdlet parameter accepts all remaining arguments that are passed to the cmdlet. The default is `false`. +`ValueFromRemainingArguments` ([System.Boolean][03]) Optional named parameter. `True` indicates that +the cmdlet parameter accepts all remaining arguments that are passed to the cmdlet. The default is +`false`. -`HelpMessage` -Optional named parameter. Specifies a short description of the parameter. Windows PowerShell displays this message when a cmdlet is run and a mandatory parameter is not specified. +`HelpMessage` ([System.String][06]) Optional named parameter. Specifies a short description of the +parameter. Windows PowerShell displays this message when a cmdlet is run and a mandatory parameter +is not specified. -`HelpMessageBaseName` -Optional named parameter. Specifies the location where resource identifiers reside. For example, this parameter could specify a resource assembly that contains Help messages that you want to localize. +`HelpMessageBaseName` ([System.String][06]) Optional named parameter. Specifies the location where +resource identifiers reside. For example, this parameter could specify a resource assembly that +contains Help messages that you want to localize. -`HelpMessageResourceId` -Optional named parameter.Specifies the resource identifier for a Help message. +`HelpMessageResourceId` ([System.String][06]) Optional named parameter.Specifies the resource +identifier for a Help message. + +`DontShow` ([System.Boolean][03]) Optional named parameter. `True` indicates that the parameter is +hidden from the user for tab expansion and IntelliSense. The default is `false`. ## Remarks -- For more information about how to declare this attribute, see [How to Declare Cmdlet Parameters](./how-to-declare-cmdlet-parameters.md). +- For more information about how to declare this attribute, see + [How to Declare Cmdlet Parameters][01]. -- A cmdlet can have any number of parameters. However, for a better user experience, limit the number of parameters. +- A cmdlet can have any number of parameters. However, for a better user experience, limit the + number of parameters. -- Parameters must be declared on public non-static fields or properties. Parameters should be declared on properties. The property must have a public set accessor, and if the `ValueFromPipeline` or `ValueFromPipelineByPropertyName` keyword is specified, the property must have a public get accessor. +- Parameters must be declared on public non-static fields or properties. Parameters should be + declared on properties. The property must have a public set accessor, and if the + `ValueFromPipeline` or `ValueFromPipelineByPropertyName` keyword is specified, the property must + have a public get accessor. -- When you specify positional parameters, limit the number of positional parameters in a parameter set to less than five. And, positional parameters do not have to be contiguous. Positions 5, 100, and 250 work the same as positions 0, 1, and 2. +- When you specify positional parameters, limit the number of positional parameters in a parameter + set to less than five. And, positional parameters do not have to be contiguous. Positions 5, 100, + and 250 work the same as positions 0, 1, and 2. - When the `Position` keyword is not specified, the cmdlet parameter must be referenced by its name. - When you use parameter sets, note the following: - - Each parameter set must have at least one unique parameter. Good cmdlet design indicates this unique parameter should also be mandatory if possible. If your cmdlet is designed to be run without parameters, the unique parameter cannot be mandatory. + - Each parameter set must have at least one unique parameter. Good cmdlet design indicates this + unique parameter should also be mandatory if possible. If your cmdlet is designed to be run + without parameters, the unique parameter cannot be mandatory. - No parameter set should contain more than one positional parameter with the same position. @@ -66,14 +87,29 @@ Optional named parameter.Specifies the resource identifier for a Help message. - Multiple parameters can define `ValueFromPipelineByPropertyName = true`. -- For more information about the guidelines for parameter names, see [Cmdlet Parameter Names](standard-cmdlet-parameter-names-and-types.md). +- For more information about the guidelines for parameter names, see [Cmdlet Parameter Names][07]. -- The parameter attribute is defined by the [System.Management.Automation.Parameterattribute](/dotnet/api/System.Management.Automation.ParameterAttribute) class. +- The parameter attribute is defined by the [System.Management.Automation.ParameterAttribute][05] + class. -## See Also +- The `DontShow` parameter has the following side effects: -[System.Management.Automation.Parameterattribute](/dotnet/api/System.Management.Automation.ParameterAttribute) + - Affects all parameter sets for the associated parameter, even if there's a parameter set in + which `DontShow` is unused. + - Hides common parameters from tab completion and IntelliSense. `DontShow` doesn't hide the + optional common parameters: **WhatIf**, **Confirm**, or **UseTransaction**. -[Cmdlet Parameter Names](standard-cmdlet-parameter-names-and-types.md) +## See Also -[Writing a Windows PowerShell Cmdlet](./writing-a-windows-powershell-cmdlet.md) +- [System.Management.Automation.Parameterattribute][05] +- [Cmdlet Parameter Names][07] +- [Writing a Windows PowerShell Cmdlet][02] + + +[01]: ./how-to-declare-cmdlet-parameters.md +[02]: ./writing-a-windows-powershell-cmdlet.md +[03]: /dotnet/api/System.Boolean +[04]: /dotnet/api/System.Int32 +[05]: /dotnet/api/System.Management.Automation.ParameterAttribute +[06]: /dotnet/api/System.String +[07]: standard-cmdlet-parameter-names-and-types.md