在PowerShell 中,switch 對應至 System.Management.Automation.SwitchParameter。4.2.6 列舉類型列舉型別是定義一組具名常數的列舉型別,代表可指派給該列舉型別之物件的所有可能值。 在某些情況下,這組值的特性導致每次只能表示其中一個值。 在其他情況下,一組值是兩個相異的乘冪,而且使用 -bor 運算符 (7.8.5)...
You can now write proxy commands that can be used to run another command. A proxy command allows you to control what functionality of the source cmdlet is available to the user. For example, you can create a proxy command that removes a parameter that is supplied by the source command. ...
-<parameter_name> <parameter_value> -<parameter_name>:<parameter_value> The name of the parameter is preceded by a hyphen (-), which signals to PowerShell that the word following the hyphen is a parameter name. The parameter name and value can be separated by a space or a colon chara...
Switch parameters are just the opposite in that you specify the parameter but the argument is left out. The interpreter assigns the parameter a value based on whether the parameter is present or not. To specify a switch type parameter, you should use the "[switch]" type literal in the para...
可以在 cmdlet 或函数代码中使用对象的属性和方法来响应使用条件。 例如,ParameterSetName 属性包含正在使用的参数集的名称,ShouldProcess 方法将 WhatIf 和Confirm 参数动态添加到 cmdlet。有关$PSCmdlet 自动变量的详细信息,请参阅 about_Functions_CmdletBindingAttribute 和about_Functions_Advanced。
公共参数也可用于使用CmdletBinding特性或Parameter特性的高级函数。 使用这些属性时,PowerShell 会自动添加通用参数。 不能创建使用与通用参数相同的名称的任何参数。 多个通用参数会重写使用 PowerShell 首选项变量设置的系统默认值或首选项。 与首选项变量不同,通用参数仅影响使用它们的命令。
When inheriting from a generic class or interface, the type parameter for the generic must already be defined. A class can't define itself as the type parameter for a class or interface. Workaround: To derive from a generic base class or interface, define the custom type in a different....
SYNTAX Get-SPSite [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>] Get-SPSite -Identity <SPSitePipeBind> [-AssignmentCollect...
If you don't use this parameter, the command is run on the local server. Expand table Type: ServerIdParameter Position: 1 Default value: None Required: False Accept pipeline input: True Accept wildcard characters: False Applies to: Exchange Server 2010, Exchange Server 2013, Exchange Server...
If you add an AliasProperty, CodeProperty, or ScriptProperty member, you can supply additional information using the SecondValue parameter. For an AliasProperty, the value must be the name of the property being aliased. For a CodeMethod, the value must be a reference to a method. Use the ...