Tree View
Tree view component for Universal Dashboard.
New-UDTreeView allows you to create a tree of items and, optionally, dynamically expand the list when clicked.

Basic Tree View

Create a basic tree view by using the New-UDTreeNode cmdlet.
1
New-UDTreeView -Node {
2
New-UDTreeNode -Name 'Level 1' -Children {
3
New-UDTreeNode -Name 'Level 2 - Item 1'
4
New-UDTreeNode -Name 'Level 2 - Item 2'
5
New-UDTreeNode -Name 'Level 2 - Item 3' -Children {
6
New-UDTreeNode -Name 'Level 3'
7
}
8
}
9
}
Copied!
Basic Tree View

Dynamic Tree View

Dynamic tree views allow you to run PowerShell whenever a node is clicked. You can then return a list of nodes that should be rendered underneath the clicked node. You can also take other actions such as opening a modal or showing a toast.
1
New-UDTreeView -Node { New-UDTreeNode -Name root } -OnNodeClicked {
2
New-UDTreeNode -name "$($EventData.Name)child"
3
}
Copied!
Dynamic Tree View
Last modified 6mo ago