Parameter sets are mutually exclusive. Once you specify a unique parameter that only exists in one parameter set, PowerShell limits you to using the parameters contained within that parameter set. For instance, you can't use the Full and Detailed parameters of Get-Help together because they belo...
[Experimental("MyModule.PSNewAddTypeCompilation", ExperimentAction.Show)] [Parameter(ParameterSet ="NewCompilation")]publicCompilationParameters CompileParameters { ... } [Experimental("MyModule.PSNewAddTypeCompilation", ExperimentAction.Hide)] [Parameter()]publicCodeDom CodeDom { ... } ...
For a sample showing how to use flag enumerations and check whether a flag is set, seeExample 3. Enumerations as parameters You can define cmdlet parameters that use an enum as their type. When you specify an enum as the type for a parameter, users get automatic completion for and valida...
You can display messages by including the server name as part of the Identity parameter or the Queue parameter or by including the Server parameter with a filter query. The Identity parameter, Queue parameter, and Filter parameter settings are mutually exclusive. You need to be assigned ...
the ModuleSpecification class to help you get the desired version of a module; this property is mutually exclusive with the ModuleVersion property. RequiredVersion is now supported as part of the value of the FullyQualifiedName parameter of the Get-Module, Import-Module, and Remo...
the script by using two sets of mutually exclusive parameters. Windows PowerShell calls theseparameter sets. The parameter sets’ names (PathandLiteralPath) are defined in the statement at the top of the script, and the script’sCmdletBindingattribute specifies thatPathis the default parameter set...
If HighPriority were mandatory, PowerShell would interpret neither to be the “Low” set with its optional parameter omitted. If a set can’t be used without a parameter, that parameter really should be mandatory, but when a set has a single parameter specifying the parameter selects the set...
The SmartHosts parameter must be set to a value that specifies a smart host. The DNSRoutingEnabled parameter must be set to $false. Although you can configure non-SMTP address spaces on a Send connector in the Transport service on a Mailbox server, the Send connector uses SMTP as the tran...
function Set-Something { [CmdletBinding()] param ( [Parameter()] [string]$Thing ) Write-Host $Thing } A function contains one or more option parameters inside of a parameter block and a body. Language constructs As a scripting language, PowerShell offers several language constructs that control...
The name of the parameter to pass this value to. password string ThePasswordfor the PSCredential value. This is mutually exclusive withvalueand must be set whenusernameis provided. username string TheUserNamefor the PSCredential value. This is mutually exclusive withvalue. ...