NEW-UDDataGrid data not output to same line

Trying to return several rows of data from a query against an AWS service (EC2 instance).

The data is returned, but it does not display the entire line of data in one horizontal line. There appears to be a line feed between each item in the data. See my example attached.

Any suggestions? My code:

New-UDPage -Url "/ucsinfo" -Name "UCSInfo" -Content {
$VerbosePreference = "Continue"

New-UDDataGrid -id 'instances' -LoadRows {
    $EC2 = Get-EC2Instance 
    $Data = $EC2 | ForEach-Object {
            @{InstanceID = "$($_.Instances[0].InstanceId)".Trim()}
            @{Name="$($_.Instances[0].Tags.GetEnumerator().Where({$_.key -eq "Name"}).value)".Trim()} 
            @{Tenant = "$($_.Instances[0].Tags.GetEnumerator().Where({$_.key -eq "Tenant"}).value)"}
        Write-Information $Data.Count
        Write-Information $Data[0].Time
        rows = $Data
        rowCount = $Data.Length
} -Columns @(
    @{field = "InstanceID" ;flex =0.2 ;sortable=$true; Filterable = $true} 
    @{field = "Name" ;flex =0.2 ;sortable=$true; Filterable = $true } 
    @{field= "Launch Time" ;flex=0.2}
    @{field= "State" ;flex=0.2 ;sortable=$true; Filterable = $true}
    @{field="Tenant";flex=.25 ;sortable=$true; Filterable = $true}

Product: PowerShell Universal

Concatenation is your friend.

Adding a ‘+’ to the end of the ForEach loop made everything line up just swell. Going to leave this up for the next poor soul that runs into something like this, or someone has a cooler solution!!

1 Like