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

Status : 

 


1
0
Sign in
to vote
ID 808599 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 11/14/2013 1:39:11 PM
Access Restriction Public

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]
Sign in to post a comment.