View Single Post
Old 04-06-2007   #5 (permalink)
John Vottero


 
 

Re: Support for "heterogeneous path hierarchies" in PS?

"Michael Herman (Parallelspace/OpenCanal)"
<mwherman@nospam.parallelspace.nospam.net.nospam> wrote in message
news:Oct5Iz%23dHHA.4964@TK2MSFTNGP04.phx.gbl...
>> It should return all of the child objects. You can return more than one
>> type of object.

>
> In a custom cmdlet, how would I receive/process/detect the different types
> of objects received via pipeline?
>


You use ParameterSetNames. If your Cmdlet can take a Widget or a Gadget as
parameter 0, you define both parameters, set both to position 0 but give
them different ParameterSetNames. Then, in ProcessRecord you can look at
the value of ParameterSetName to see which object you have.

My System SpecsSystem Spec