- Product: PowerShell Universal
- Version: 1.58
- Dashboard Framework: Latest
Hi all
I cannot get the -DefaultValue option to work with a Variable, I can see the variable does match the New-UDSelectOption name and is available to the object by placing it in the New-UDSelect -Label, see below
$Session:CurrentSettingValue = $EventData.Setting
New-UDSelect -Label $Session:CurrentSettingValue -Option {
New-UDSelectOption -name "True" -Value "True"
New-UDSelectOption -name "False" -Value "False"
} -DefaultValue $Session:CurrentSettingValue -OnChange {
#}
However if i use a string it does work, ie
$Session:CurrentSettingValue = $EventData.Setting
New-UDSelect -Label $Session:CurrentSettingValue -Option {
New-UDSelectOption -name "True" -Value "True"
New-UDSelectOption -name "False" -Value "False"
} -DefaultValue "False" -OnChange {
#}
I’ve tried formatting $Session:CurrentSettingValue as " $Session:CurrentSettingValue" & "$($Session:CurrentSettingValue)" and there is no change.
Any ideas?