Then there are other parameters that must always be used when the cmdlet is run. You will find that
most cmdlets that take an action such as creating, modifying, or removing items have at minimum one
required parameter to identify the items on which to take action. If any required parameters are left out
when running a cmdlet, Windows PowerShell prompts the user to enter an input value for each of the
missing required parameters.
The Identity parameter is one of the most common required parameters, typically used by cmdlets
that need as input the name of the object on which to take some action. For example, the Set-User
cmdlet modifies attributes on an existing user account in the Active Directory directory service.
The Identity parameter is required when using Set-User and is used to identify the user account
on which the changes are to be made.
In Figure 1 - 8 , the Set-User cmdlet is being used to set the Department attribute, but the Identity
parameter was not used to name the target user so the shell prompts the operator for the missing value.
Figure 1-8
Positional and Named Parameters
Another parameter characteristic to consider is whether a parameter is positional or named. A positional
parameter can be used without actually entering the parameter name, as long as the input value is in the
position where the parameter name would normally have been used.
Pages:
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45