description | ms.date | ms.topic | title |
---|---|---|---|
Common Parameter Names |
10/04/2023 |
reference |
Common Parameter Names |
The parameters described in this topic are referred to as common parameters. They're added to cmdlets by the PowerShell runtime and can't be declared by the cmdlet.
Note
These parameters are also added to provider cmdlets and to functions that are decorated with the
CmdletBinding
attribute.
The following parameters are added to all cmdlets and can be accessed whenever the cmdlet is run. These parameters are defined by the CommonParameters class.
Data type: SwitchParameter
This parameter specifies whether programmer-level debugging messages that can be displayed at the command line. These messages are intended for troubleshooting the operation of the cmdlet, and are generated by calls to the WriteDebug method. Debug messages don't need to be localized.
Data type: Enumeration
This parameter specifies what action should take place when an error occurs. The possible values for this parameter are defined by the ActionPreference enumeration.
Data type: String
This parameter specifies the variable in which to place objects when an error occurs. To append to this variable, use +varname rather than clearing and setting the variable.
Data type: Enumeration
This parameter specifies what action should take place when output is sent to the Information stream. The possible values for this parameter are defined by the ActionPreference enumeration.
Data type: String
This parameter specifies the variable in which to save output objects written to the Information stream. To append to this variable, use +varname rather than clearing and setting the variable.
Data type: Int32
This parameter defines the number of objects to store in the output buffer before any objects are passed down the pipeline. By default, objects are passed immediately down the pipeline.
Data type: String
This parameter specifies the variable in which to place all output objects generated by the cmdlet. To append to this variable, use +varname rather than clearing and setting the variable.
Data type: String
This parameter stores the value of the current pipeline element as a variable for any named command as it flows through the pipeline.
Data type: Enumeration
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider,
such as the progress bars generated by the Write-Progress
cmdlet.
This parameter was added in PowerShell 7.4.
Data type: SwitchParameter
This parameter specifies whether the cmdlet writes explanatory messages that can be displayed at the command line. These messages are intended to provide additional help to the user, and are generated by calls to the WriteVerbose method.
Data type: Enumeration
This parameter specifies what action should take place when the cmdlet writes a warning message. The possible values for this parameter are defined by the ActionPreference enumeration.
Data type: String
This parameter specifies the variable in which warning messages can be saved. To append to this variable, use +varname rather than clearing and setting the variable.
The following parameters are added to cmdlets that requests confirmation before they perform their action. For more information about confirmation requests, see Requesting Confirmation. These parameters are defined by the ShouldProcessParameters class.
Data type: SwitchParameter
This parameter specifies whether the cmdlet displays a prompt that asks if the user is sure that they want to continue.
Data type: SwitchParameter
This parameter specifies whether the cmdlet writes a message that describes the effects of running the cmdlet without actually performing any action.
The following parameter is added to cmdlets that support transactions. These parameters are defined by the TransactionParameters class.
Transaction support was introduced in PowerShell 3.0 and discontinued in PowerShell 6.0.
Data type: SwitchParameter
This parameter specifies whether the cmdlet uses the current transaction to perform its action.
- about_CommonParameters
- System.Management.Automation.Internal.CommonParameters
- System.Management.Automation.Internal.ShouldProcessParameters
- System.Management.Automation.Internal.TransactionParameters
- Writing a Windows PowerShell Cmdlet
- Windows PowerShell SDK