From acbc512936d44d52680b81cbc961c3b6429987a9 Mon Sep 17 00:00:00 2001 From: Tobias Fredriksson Date: Wed, 21 Aug 2019 12:31:18 +0200 Subject: [PATCH] Fix for #694 --- .../Cmdlets/Inputs/NewInputFieldCommand.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,