Product: PowerShell Universal
Version: 1.5.15
UniversalDashboard: 3.3.4
In powershell universal dashboard v2.9 I used to do a New UDTable that would let you list properties of a hash table like this.
Respective Code:
New-UDTable -Title “$($MU.UserPrincipalName) Details” -Headers @(" ", " ") -Endpoint {
@{
‘Name’ = $MU.DisplayName
‘Email’ = $MU.UserPrincipalName
‘Licensed’ = if($MU.IsLicensed -eq $true) {“Yes”} else {“No”}
‘Password Changed’ = $MU.LastPasswordChangeTimestamp
‘Sign-in Blocked’ = if($MU.BlockCredential) {“Yes”} else {“No”}
‘Admin Roles’ = $MUR.Name -join ', ’
}.GetEnumerator() | Out-UDTableData -Property @(“Name”, “Value”)
}
I when I pass a similar hash table to the -Data parameter of the v3 New-UDTable I get this.
Respective code:
$TableData = @{
‘Password Changed’ = $MU.LastPasswordChangeDateTime
Name = $MU.DisplayName
‘Admin Roles’ = $MUR.DisplayName -join ', ’
Email = $MU.UserPrincipalName
‘Enabled’ = $MU.AccountEnabled
}
$TableColumns = @(
New-UDTableColumn -Property Name -Title ’ ’
New-UDTableColumn -Property Value -Title ’ ’
)
New-UDTable -Data ($TableData.GetEnumerator()) -Columns $TableColumns
How can I accomplish this in v3’s New-UDTable?