Is there an easy way to tell what datatype a parameter is for New-UDInput?

for example,

New-InputField -Type checkbox

translates to

param( [bool] $Checkbox)

and

New-InputField -Type textbox

translates to

param( [string] $Text)

is there a way to find out what -type select,radioButtons, textarea, etc translate to in terms of datatype?

I found the types at https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Cmdlets/Inputs/NewInputCommand.cs#L79

but simply changing tto [System.Enum] $mySelect didn’t change it. Feels like I’m missing something.

EDIT:

after some investigation into the cs class, it appears the select type will automatically be chosen if there is an enumerator. So to make a select, you’d just do

[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateSet(
    "Account Access",
    "Network Connectivity",
    "Software",
    "Hardware",
    "Printing",
    "Other"
)]
[String] $IssueType

EDIT 2:

The difference bettween textbox and text area is defined if the parameter accepts an array or not:

[Parameter(Mandatory)]
    [string] $Title, # textbox 

    [string[]] $Notes # textarea
1 Like