PowerShell - Parameter Value Tab Expansion for Enum types

Posted by Adam Driscoll on Stack Overflow See other posts from Stack Overflow or by Adam Driscoll
Published on 2010-05-17T15:48:19Z Indexed on 2010/05/17 15:50 UTC
Read the original article Hit count: 1064

Filed under:
|
|

Is it possible to implement parameter value tab expansion for enum parameter types?

Creating a binary cmdlet with parameter definition:

[Parameter]
public SomeEnum Type {get;set;} 

Is there some way to type:

Add-MyThing -Type S<tab> 

To get:

Add-MyThing -Type SomeEnumValue

Where:

public enum SomeEnum 
{
   SomeEnumValue,
   SomeEnumValue2
}

I know it may be possible with overriding the TabExpansion function but I was wondering if there was something I could do within my cmdlet to expose this type of functionality.

© Stack Overflow or respective owner

Related posts about powershell

Related posts about tabexpansion