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...
Examples of parameter sets Unique parameter Multiple parameter sets Parameter set requirements Show 2 more 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...
(Get-CommandMeasure-Lines).ParameterSets |Select-Object-Property@{n='ParameterSetName';e={$_.name}}, @{n='Parameters';e={$_.ToString()}} Output ParameterSetName Parameters --- --- Path [-Path] <string[]> [-Lines] [-Words] [-Characters] [-Recurse] [<CommonParameters>] PathAll [...
ExamplesExample 1PowerShell Copy Set-ServerComponentState -Component UMCallRouter -Identity MailboxServer01 -Requester Maintenance -State ActiveThis example sets the Unified Messaging (UM) component state to Active, as requested by maintenance mode....
Examples Example 1 PowerShell Set-PopSettings-Server"MBX01"-UnencryptedOrTLSBindings10.0.0.0:110 This example configures the unencrypted or STARTTLS encrypted POP3 connection to the server named MBX01 by using the local IP address 10.0.0.0 on TCP port 110. ...
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-MailboxDatabase"Mailbox Database01"-DeletedItemRetention7.00:00:00 This example sets the length of time that deleted items are retained. If a specific mailbox has its own item retention set, that value is used instead of this value, which is set on the ...
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...
This is very similar to how other scripting languages work such as Perl. While the $args variable is a simple way to get at the arguments to a script, it requires a bit of work to do anything beyond simple examples. The param statement ...
The hash table values are displayed by entering $PSDefaultParameterValues at the PowerShell prompt.A $PSDefaultParameterValues hash table is set with three Key/Value pairs. This hash table is used in the following examples that describe how to add, change, and remove values from $P...