PowerShell Advanced Function get current ParameterSetName

Posted by spoon16 on Stack Overflow See other posts from Stack Overflow or by spoon16
Published on 2010-04-27T04:30:48Z Indexed on 2010/04/27 4:33 UTC
Read the original article Hit count: 756

Filed under:
|

In C# you can get the current ParameterSetName in the ProcessRecord override of a PowerShell Cmdlet with code like this:

 switch (ParameterSetName)
 {
      case FromUriParamSetName:
           loadFromUri();
           break;

      case FromFileParamSetName:
           loadFromFile();
           break;
 }

I'm trying to figure out how I can get the value for ParameterSetName in a script cmdlet (Advanced Function).

© Stack Overflow or respective owner

Related posts about powershell

Related posts about cmdlet