I am seeing odd behavior when using New-UDTableColumn and displaying the $EventData. I have two columns I am processing from the same object and one works and displays find and the other does not - it does show the value in the UDToast but does not include it on the table.
I have also tried different ways of tackling this including moving the logic part outside of the New-UDTableColumn block and instead using a New-UDTableColumn with -Render else just New-UDTableColumn to get the desired effect and it reverses the issue where the UDSelect then doesn’t show the EventData as desired.
This behaved the same in PSU 2.1.2 and I updated to PS 2.2.1 hoping it might fix it but it did not.
Thanks in advance.
New-UDTableColumn -Property BlockSizeKB -Title 'BlockSizeKB' -Align Center -Render {
$BlockSizeKBList = @(
' '
'1'
'2'
'4'
'8'
'16'
'32'
'64'
)
if ($EventData.BlockSizeKB -match '^\d+') {
Show-UDToast -Message $EventData.BlockSizeKB -Duration 10000
$EventData.BlockSizeKB
} else {
New-UDSelect -Id "BlockSizeKBList_$($EventData.DiskNumber)" -Option {
$BlockSizeKBList | ForEach-Object {
New-UDSelectOption -Name $_ -Value $_
}
} -DefaultValue ' '
}
}
New-UDTableColumn -Property PartitionStyle -Title 'PartitionStyle' -Align Center -Render {
$PartitionStyleList = @(
'RAW'
'MBR'
'GPT'
)
if ($EventData.PartitionStyle.ToUpper() -eq 'RAW') {
New-UDSelect -Id "PartitionStyleList_$($EventData.DiskNumber)"-Option {
$PartitionStyleList | ForEach-Object {
New-UDSelectOption -Name $_ -Value $_
}
} -DefaultValue $EventData.PartitionStyle.ToUpper()
} else {
$EventData.PartitionStyle
}
}
Toast:
Product: PowerShell Universal
Version: 2.2.1