Common parameters

When looking at the syntax, you will see that most commands end with a CommonParameters item:

SYNTAX
Get-Process ... [<CommonParameters>]

These common parameters are documented inside PowerShell:

Get-Help about_CommonParameters 

These parameters let you control some of the standardized functionality PowerShell provides, such as verbose output and actions to take when errors occur.

For example, Stop-Process does not explicitly state that it has a Verbose parameter, but as Verbose is a common parameter it may be used. This can be seen if notepad is started and immediately stopped:

PS> Start-Process notepad -Verbose -PassThru | Stop-Process -Verbose
VERBOSE: Performing the operation "Stop-Process" on target "notepad (5592)".
Not so verbose

Just because a command supports a set of common parameters does not mean it must use them; for example, Get-Process supports the Verbose parameter, yet it does not write any verbose output.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.104.214