Home Dashboard Directory Help
Search

enum, ValidateSet, and ValidateRange Mandatory parameters should generate help by Derp McDerp


Status: 

Active


1
0
Sign in
to vote
Type: Suggestion
ID: 808599
Opened: 11/14/2013 1:39:11 PM
Access Restriction: Public
0
Workaround(s)
view

Description

& { param([Parameter(Mandatory)][System.TypeCode]$x) }

Should generate a (!?) help string displaying the enum choices:

Valid options: Empty, Object, DBNull, Boolean, Char, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Double, Decimal, DateTime, String

& { param([ValidateSet('a','b')][Parameter(Mandatory)]$x) }

Should generate a (!?) help string displaying the following choices:

Valid options: a, b

& { param([ValidateRange(1,10)][Parameter(Mandatory)]$x) }

Should generate a (!?) help string displaying the range the parameter can take:

Range in [1, 10]
Details
Sign in to post a comment.
Sign in to post a workaround.