Datasheet

18 CHAPTER 1
USING POWERSHELL WITH ACTIVE DIRECTORY
TABLE 1.3 Parameters for the
Get-Help
Cmdlet
Parameter Description
-Examples
Displays various examples that demonstrate the use of the cmdlet
-Detailed
Displays detailed information on the cmdlet, including a description of each
parameter that is accepted
-Full
Displays the full output of the technical information for the cmdlet
Format the Output of a Command
Sometimes, when you run a command, the output is di cult to read or you dont get
all the information you wanted. You can change the output of the cmdlets that you
run in various ways.  is is accomplished using cmdlets beginning with
Format-
.
ere are multiple
Format-
cmdlets that will format the output into multiple views.
To use them, you simply pipeline the output from one cmdlet into the appropriate
format cmdlet. For example, if you want to view the running processes as a list, you
can pipeline the output to the
Format-List
cmdlet:
Get-Process | Format-List
To view the list of available format cmdlets, you can run the
Get-Command
cmdlet:
PS C:\> Get-Command format-*
CommandType Name Definition
----------- ---- ----------
Cmdlet Format-Custom Format-Custom [[-Property] <...
Cmdlet Format-List Format-List [[-Property] <Ob...
Cmdlet Format-Table Format-Table [[-Property] <O...
Cmdlet Format-Wide Format-Wide [[-Property] <Ob...
Test What a Command Will Do
ere may be times when you just want to see the output of a particular command
to make sure you have it right, without making the actual change to the system.
is is especially useful when you’re writing scripts, as covered in the next section,
“Script Administration Tasks.” To  nd out what is a ected by a command without
actually running it, you can use the
-WhatIf
parameter.
Perhaps you’re trying to  gure out if you have the syntax of a cmdlet right, but
you don’t want to accidently run the cmdlet if you happen to get it right. In
this case, you can use the
-Confirm
parameter. Doing so adds a con rmation
c01.indd 18c01.indd 18 5/12/2011 1:07:47 PM5/12/2011 1:07:47 PM