Product: PowerShell Universal
Version: 3.6.1
I’m trying to colorize certain fields depending on their values, however they’re just showing as System.Collection.Hashtable
Neither New-UDHTML or New-UDTypography work
foreach($user in $users)
{
if($user.suffix -eq '[]')
{
$suffix = "None"
}
else
{
$suffix = ($user.suffix|convertFrom-json).length
}
if($user.tokens -eq 0)
{
$tokens = New-UDTypography -Text 'None' -Style @{ color = 'red' }
#$tokens = "none"
#$tokens = New-UDHTML -markup '<p style="color:red;"> None.</p>'
}
else
{
$tokens = $user.tokens
#bldfjslkafjldks
}
@{
Username = $user.userID
Tokens = $tokens
Suffixes = $suffix
}
}
)
$columns = @(
New-UDTablecolumn -property Username -title 'Username'
New-UDTablecolumn -property Tokens -title 'Tokens'
New-UDTablecolumn -property Suffixes -title 'Suffixes'
)
New-UDTable -id 'UsersTable' -Data $array -columns $columns
The values come out as System.Collection.Hashtable
: