Datasheet
Part I: PowerShell for Exchange Fundamentals
14
For example, the Identity parameter is typically a positional parameter used in position 1 after the
cmdlet name. The
Get-Mailbox cmdlet uses the Identity parameter in position 1 to identify the
mailbox - enabled user for which to retrieve information. In Figure 1 - 9 , you can see that the results of
running the
Get-Mailbox cmdlet with and without the Identity parameter name are identical as long
as the input value is supplied in the first position after the cmdlet name.
Figure 1-9
If a parameter is not positional, then it is named. To use a named parameter you must always enter the
parameter name followed by the input value. The order in which you enter named parameters and their
input value on the command line does not matter because the shell ’ s command parser interprets the
command in total before execution.
Parameter Shortcuts
Another time - saving feature you may find useful is parameter name shortcuts. When entering the name
of a parameter, you need to supply only enough of a parameter ’ s name to disambiguate it from any
other parameter name. In the following example the first command uses the
Set-User cmdlet to set the
Manager attribute on user account John Doe to his manager Jane Doe . -ma is enough information for
the shell to interpret the parameter name
Manager so the command succeeds. In the second command,
-po is being used to refer to the PostalCode parameter. However, -po is ambiguous and also matches
parameter
PostOfficeBox . In this case the command fails with the error shown Figure 1 - 10 .
Figure 1-10
c01.indd 14c01.indd 14 12/17/07 3:19:26 PM12/17/07 3:19:26 PM