Output object in dashboard like job pipeline output

If you execute a script and return an object, in the job pipeline output you have a nice tree view style output of that object, can expand/hide nested objects, and click to copy properties to clipboard.

I have a fairly complex object that I want to display in a dashboard and would want to see it like that. I don’t suppose there’s an easy way to get an object to display like that in the dashboards?

Thanks

Product: PowerShell Universal
Version: 2.2.1
1 Like

There isn’t at the moment. You should be able to do a little magic with Get-Member and New-UDTreeView to accomplish this. Maybe someone else has an example. If you get stuck, I’m happy to work something out.

Thanks Adam. Not sure how I would use get-member there, but I got it to display by manually creating the hierarchy that has nested objects, then enumerating them like this

foreach ($property in $object.nestedobject.psobject.properties) {
  New-UDTreeNode -Name "$($property.name) = $($property.Value)"
}

I suspect I know the answer since it’s not in the documentation, but I don’t suppose I can make the UDTreeView column wider so it can use more real estate before wrapping, or hide the dropdown arrow for items that don’t have children?

Cool. Good solution.

You might be able to make it wider with New-UDStyle: Styles - PowerShell Universal

It would take some custom CSS.

As for the hiding the drop downs, probably not possible without changes on my end. I’m happy to open an issue for those enhancements.

I would like to get an option to change or hide the drop down as well, may an icon option.

I’m displaying an INI file as a tree view and actual settings should not get an arrow.