引數集用於限制引數的組合
placeholderCopyFunction Do-Something
{
Param
(
[Parameter(Mandatory=$true)]
[String]$SomeThingToDo,
[Parameter(ParameterSetName="Silently", mandatory=$false)]
[Switch]$Silently,
[Parameter(ParameterSetName="Loudly", mandatory=$false)]
[Switch]$Loudly
)
#Do something
}
# This will not work because you can not use the combination Silently and Loudly
Do-Something -SomeThingToDo 'get-help about_Functions_Advanced' -Silently -Loudly