$EventData Custom Column Rendering

Product: PowerShell Universal
Version: 3.1.0

I have a SQL Pivot query that takes a bunch of SQL Server names and makes them columns grouped by the availability group name. If the AG exists on the server either as a primary or secondary, the value is > 1… else 0.

Because this is a pivot query, and new servers (columns) may be added in the future, I had to loop over one of the objects/datarows in PSU to dynamically create my column list:

$Columns = @()

foreach ($Server in ($data[0] | gm | where-object {$_.MemberType -eq 'property'}).Name){

    $Columns += New-UDTableColumn -Property "$Server" -Title "$Server" -Render {

        if((($EventData.$Server)) -ne 0) {
            New-UDIcon -Icon Database
        else {
            New-UDTypography -Text "$($EventData.$Server)"

    New-UDTable -Data $Data -Column $Columns

However, it appears that the row in my table within PSU only render the last value in the row itself:

It seems that the context is thrown out the window when foreach is introduced. When I separate the columns manually it seems to work just fine, but that also means I have to define each column manually =[