diff --git a/src/UniversalDashboard/Cmdlets/Inputs/NewInputFieldCommand.cs b/src/UniversalDashboard/Cmdlets/Inputs/NewInputFieldCommand.cs index 635dd8a4..1b18c083 100644 --- a/src/UniversalDashboard/Cmdlets/Inputs/NewInputFieldCommand.cs +++ b/src/UniversalDashboard/Cmdlets/Inputs/NewInputFieldCommand.cs @@ -9,7 +9,7 @@ namespace UniversalDashboard.Cmdlets.Inputs { - [Cmdlet(VerbsCommon.New, "UDInputField")] + [Cmdlet(VerbsCommon.New, "UDInputField")] public class NewInputFieldCommand : PSCmdlet { [Parameter(Mandatory = true)] @@ -44,6 +44,10 @@ public class NewInputFieldCommand : PSCmdlet private readonly Logger Log = LogManager.GetLogger(nameof(NewInputFieldCommand)); protected override void EndProcessing() { + if (Type == "select" && (null == DefaultValue || DefaultValue.ToString() == "") && Values.Count() >= 0) + { + DefaultValue = Values[0]; + } var field = new Field { Name = Name,