Beruflich Dokumente
Kultur Dokumente
about_Parameters
SHORT DESCRIPTION
Describes how to work with cmdlet parameters in
Windows PowerShell.
LONG DESCRIPTION
Most Windows PowerShell cmdlets and functions r
ely on parameters to allow
users to select options or provide input. The p
arameters follow the cmdlet
or function name and typically have the followi
ng form:
-<parameter_name> <parameter_value>
-path <string[]>
Specifies a path of one or more locatio
ns. Wildcard characters are
permitted. The default location is the
current directory (.).
Required? false
Position? 1
Default value Current direct
ory
Accept pipeline input? true (ByValue,
ByPropertyName)
Accept wildcard characters? true
Parameter Required?
This setting indicates whether the parameter is
mandatory, that
is, whether all commands that use this cmdlet m
ust include this
parameter. When the value is "True" and the par
ameter is missing
from the command, Windows PowerShell prompts yo
u for a value for
the parameter.
Parameter Position?
This setting indicates whether you can supply a
parameter's value
without preceding it with the parameter name. I
f set to "0" or "named,"
a parameter name is required. This type of para
meter is referred to as
a named parameter. A named parameter can be lis
ted in any position
after the cmdlet name.
Parameter Type
This setting specifies the Microsoft .NET Frame
work type of the parameter
value. For example, if the type is Int32, the p
arameter value must be an
integer. If the type is string, the parameter v
alue must be a
character string. If the string contains spaces
, the value must be
enclosed in quotation marks, or the spaces must
be preceded by the
escape character (`).
Default Value
This setting specifies the value that the param
eter will assume
if no other value is provided. For example, the
default value of
the Path parameter is often the current directo
ry. Required
parameters never have a default value. For many
optional parameters,
there is no default because the parameter has n
o effect if it is
not used.
$s = "winrm", "netlogon"
get-service -servicename $s
Accepts Pipeline Input?
This setting indicates whether you can use the
pipeline operator
(|) to send a value to the parameter.
Value Description
----- -----------
False Indicates that you can
not pipe a value to the
parameter.
Common Parameters
Common parameters are parameters that you can u
se with any cmdlet.
For more information, about common parameters,
type:
help about_commonparameters
SEE ALSO
about_Command_syntax
about_Comment_Based_Help
about_Functions_Advanced
about_Pipelines
about_Wildcards