about_Parameters_Default_Values about_Parameter_Sets about_Parsing about_Path_Syntax about_Pipelines about_Pipeline_Chain_Operators about_PowerShell_Config about_PowerShell_Editions about_Preference_Variables about_Profiles about_Prompts about_Properties ...
$PSDefaultParameterValues.Add("Get-Process:Name","PowerShell") 以下语法实现相同的结果。 PowerShell $PSDefaultParameterValues["Get-Process:Name"]="PowerShell" 变量$PSDefaultParameterValues显示更新的哈希表。 已Get-Process:Name添加密钥。 PS> $PSDefaultParameterValues Name Value ...
接受管道输入 (by Value) 或 (by PropertyName) 的类型化参数允许对参数使用延迟绑定脚本块。 延迟绑定脚本块在ParameterBinding期间自动运行。 结果绑定到 参数。 延迟绑定不适用于定义为类型ScriptBlock或System.Object的参数,脚本块是在未调用的情况下传递的。
Name Value --- --- Foo Bar 还可以使用 复制环境变量,使用Copy-Item设置环境变量的值,使用Set-Item列出环境变量Get-Item,并使用Remove-Item删除环境变量。 PowerShell复制 Copy-Item-PathEnv:\Foo-DestinationEnv:\Foo2-PassThruSet-Item-PathEnv:\Foo2-Value'BAR'Get-Item-PathEnv:\Foo*Remove-Item-Path...
CmdletBinding Property System.Boolean CmdletBinding {get;} CommandType Property System.Management.Automation. CommandTypes CommandType {get;} DefaultParameterSet Property System.String DefaultParameterSet {get;} Definition Property System.String Definition {get;} Description Property System.String Description {ge...
类型:SwitchParameter 别名:cf Position:Named 默认值:False 必需:False 接受管道输入:False 接受通配符:False -DefaultDisplayProperty 未指定任何其他属性时,指定由Format-Widecmdlet 显示的类型的属性。 键入类型的标准或扩展属性的名称。 此参数的值可以是已添加到同一命令中的类型的名称。
-PSAllowRedirection <SwitchParameter> 允许将连接重定向到目标计算机。 使用PSConnectionURI参数时,远程目标将返回一个指令,以重定向到不同的 URI。 默认情况下,Windows PowerShell 不会重定向连接,但你可以使用PSAllowRedirection参数,以允许将连接重定向到目标计算机。
$false: The cloud-based storage location for the users specified in the ExchangeLocation parameter won't be included in the search. This is the default value. Expand table Type: Boolean Position: Named Default value: None Required: False Accept pipeline input: False Accept wildcard characters:...
The ErrorAction parameter is used to override the $ErrorActionPreference value. This example shows the $ErrorActionPreference default value, Continue. A non-terminating error is generated. The message is displayed and processing continues. PowerShell Copy # Change the ErrorActionPreference to ...
public string Parameter1; [Parameter(Mandatory = true, ValueFromPipeline = true)] public string InputObject; protected override void ProcessRecord() { if ( Parameter1 != null ) { WriteObject(Parameter1 + ":" + InputObject); } else { ...