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()}
@{Time="$($_.Instances[0].LaunchTime)"};@{State="$($_.Instances[0].State.Name)"}
@{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}
)-AutoHeight
}
Product: PowerShell Universal