Product: PowerShell Universal
Version: 5.3.2
Description:
When using the variable name $rows
in a Universal Dashboard script—even when populated with static data—the UDTable component fails to render properly and throws an unexpected error. Changing the variable name (for example, to $dataRows
) allows the table to render as expected, suggesting a naming conflict with an internal variable or reserved keyword within Universal Dashboard.
Steps to Reproduce:
- Create a PowerShell script with static data stored in a variable named
$rows
:
# Static data assigned to $rows
$rows = @(
@{ Id = 1; Name = "Alice" }
@{ Id = 2; Name = "Bob" }
)
- Create a Universal Dashboard page that displays a UDTable with some static data:
$homePage = New-UDPage -Name "Home" -Url "/home" -Content {
$Data = @(
@{ Name = "Item A"; Value = 100 }
@{ Name = "Item B"; Value = 200 }
)
New-UDTable -Data $Data
}
New-UDApp -Title "Test Dashboard" -Pages $homePage
- Launch the dashboard. The UDTable fails to render and displays an error message similar to:
Error rendering component (mu-table)
This error is not expected. Please report it to Ironman Software.
- Rename the variable from
$rows
to another name (e.g.,$dataRows
) and rerun the script:
$dataRows = @(
@{ Id = 1; Name = "Alice" }
@{ Id = 2; Name = "Bob" }
)
- In this case, the UDTable renders correctly.
Expected Behavior:
The UDTable component should render correctly regardless of the variable names used in the script. Using $rows
should not cause any conflicts or errors.
Observed Behavior:
- With
$rows
used to store static data, the UDTable component fails to render and an error is thrown. - Changing the variable name (for example, to
$dataRows
) resolves the issue, and the table renders as expected.
Please investigate and resolve the naming conflict between the variable $rows
and any internal variables used by the UDTable component. If $rows
is a reserved name, please update the documentation to warn users and recommend using an alternative variable name.