Custom Table Property Error in v5 OnRowExpand

I cannot use a Custom Table Property with -OnRender anymore inside of -OnRowExpand

Example Code (works in v4 but not in v5) - New-UDTableColumn -Property 'NoneExistent' -OnRender

$Data = @(
    @{Dessert = 'Frozen yoghurt'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
    @{Dessert = 'Gingerbread'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
) 

New-UDTable -Data $Data -ShowSearch -Columns @(
    New-UDTableColumn -Property 'Dessert'
    New-UDTableColumn -Property 'Calories'
) -OnRowExpand {
    New-UDPaper -Content{
        New-UDRow{
            New-UDColumn -LargeSize 6 -ExtraLargeSize 6 -Content {
                New-UDCard -Content{
                New-UDCardHeader -Title "Calories, Fats, Carbs and Protein"
                New-UDTable -Data $EventData -Columns @(
                        New-UDTableColumn -Property 'Fat' -Style @{'width' = "5%"}
                        New-UDTableColumn -Property 'Carbs' -Style @{'width' = "5%"}
                        New-UDTableColumn -Property 'Protein' -Style @{'width' = "5%"}
                        New-UDTableColumn -Property 'NoneExistent' -OnRender {
                            'Something'
                        }
                   )
                }#End Card
            }#End Column
        }#End Row
    }#End Paper
}

Error

One or more errors occurred

Error getting value from 'Description' on 'System.Management.Automation.PSSnapInInfo'.
Product: PowerShell Universal
Version: 5.0.5

I can reproduce this. I’ll open an issue.

Confirmed fixed in 5.0.6

1 Like