You get the following error:
- CategoryInfo : InvalidArgument: (:) [], ParameterBindingException
-
FullyQualifiedErrorId : AmbiguousParameterSet,
The reason
You have this error in two situations:
- Your command-line uses simultaneously two or more parameters members of different exclusive parameter sets.
Your command-line doesn’t use any of the parameters members of a parameter set.
Let’s illustrate your error
Example 1
There are two sets of parameters.
In green you have parameters which are members of both parameter sets A and B.
You can use any of those green parameters whenever you want.
In blue you have parameters which are exclusively members of parameter set A.
In orange you have parameters which are exclusively members of parameter set B.
If you use at least one parameter of set A, you can’t use any parameter of set B, and conversely.
For instance, if you use the AsJob parameter, you cannot use the Timeout parameter.
However, you are not obliged to use any of the exclusive parameters.
If you use a green parameter, it is sufficient to meet the parameterset rules.
Example 2
There are still two sets of parameters.
But, in green you have parameters which are not member of any parameter set.
You can use any of those green parameters whenever you want.
In blue you have parameters which are exclusively members of parameter set A.
In orange you have parameters which are exclusively members of parameter set B.
Like in our first example, if you use at least one parameter of set A, you can’t use any parameter of set B, and conversely.
However, unlike in our first example, you have to use at least one parameter of any of any parameter sets.
This means for example using the AsJob parameter or the Timeout parameter.