So I must be having a bad day. The Switch in the below code only ever triggers the default selection despite the fact that the default selection throw up a Toast showing that the $Body type is a string and has a value that matches on of the other options!
New-UDRadioGroup -Id 'rdFilter' -Label "Filter Type" -Content {
New-UDRow -Columns {
New-UDColumn -LargeSize 3 -Content {
New-UDRadio -Label "PowerShell Expression Language" -Value 'PSELFILTER'
}
New-UDColumn -LargeSize 3 -Content {
New-UDRadio -Label "LDAP" -Value 'LDAPFILTER'
}
}
} -OnChange {
$Radio = $Body
switch ($Radio)
{
('PSELFILTER') {
Set-UDElement -Id 'txtFilter' -Properties @{'helperText' = "$pselfilter" }
}
('LDAPFILTER') {
Set-UDElement -Id 'txtFilter' -Properties @{'helperText' = "$ldapfilter" }
}
Default {
Show-UDToast -Message "$($Body.GetType()) $Body" -Duration 3000
Set-UDElement -Id 'txtFilter' -Properties @{'helperText' = "$ldapfilter" }
}
}
}-Value 'PSELFILTER'
Product: PowerShell Universal
Version: 3.2.8