PowerShell uses parameter sets to enable you to write a single cmdlet that can do different actions for different scenarios. Parameter sets enable you to expose different parameters to the user. And, to return
定义了多个参数集时,CmdletBinding 属性的 DefaultParameterSetName 关键字将指定默认参数集。 当PowerShell 无法根据提供给命令的信息确定所要使用的参数集时,它会使用默认参数集。 有关 CmdletBinding 属性的详细信息,请参阅 about_Functions_CmdletBindingAttribute。 声明参数集 若要创建参数集,必须为参数集中的每个参数...
One of the great benefits of PowerShell V2 Advanced Functions is the ease in which you can support parametersets. ParameterSets are, well, different SETS of valid parameters. For instance you can say: Get-Process -id 0 Get-Process -Name *ss Those are 2 different parametersets for the Get...
page https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7#parametersetname-argument contain next note "For more information about parameter sets, see Cmdlet Parameter Sets." and forward users to this page that does...
This examples show details of the compliance search named Case 1234. Parameters -Case This parameter is available only in the cloud-based service. The Case parameter filters the results by the name of an eDiscovery Standard case that the compliance search is associated with. If the value contain...
When multiple parameter sets are defined, the cmdlet can indicate which parameter set to use if Windows PowerShell doesn't have enough information to make that determination. The parameter set that is used in this case is referred to as the default parameter set, and is specified using the ...
Examples Example 1 PowerShell Set-ServerComponentState-IdentityMailboxServer01-ComponentUMCallRouter-RequesterMaintenance-StateActive This example sets the Unified Messaging (UM) component state to Active, as requested by maintenance mode. Example 2 ...
-DisablePrivateUNCAccess (Optional) This parameter will disable File Share access via the Private FBA access option. -SetLegacyVDirs (Optional) This parameter sets the same options on /exchange, /public, and /exchweb that are used on /owa. --- EXAMPLE 1 --- .\ConfigureOWA.ps1 -Server C...
For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.SyntaxPowerShell Copy Set-ComplianceSearch [-Identity] <ComplianceSearchIdParameter> [-AddExchangeLocation <String[]>] [-AddExchangeLocationExclusion <String[]>] [-AddSharePointLocation <String[]>] [-...
Sets an associated Runspace for this PowerShell instance. This can be null in which case a new runspace is created whenever Invoke* method is called. RunspacePool Sets an associated RunspacePool for this PowerShell instance. A Runspace from this pool is used whenever Invoke* method is called...