Universal Dashboard is now a part of PowerShell Universal. This documentation is for reference to the v2 version of Universal Dashboard and is no longer maintained. PowerShell Universal Documentation can be found here.
A standard tab control that allows you to specify multiple tabs with a title and content. You can place any UD element within the content.
You'll need to create an outer tab container and then include one or more tabs within the container. Each tab needs a Text for the title and a Content script block.
New-UDTabContainer -Tabs {New-UDTab -Text "Tab 1" -Content {New-UDElement -Tag 'div' -Content { "Tab 1 Content"}}New-UDTab -Text "Tab 2" -Content {New-UDElement -Tag 'div' -Content { "Tab 2 Content"}}New-UDTab -Text "Tab 3" -Content {New-UDElement -Tag 'div' -Content { "Tab 3 Content"}}}
For performance reasons, you may not want a tab to render it's content unless it's displayed. This is helpful for auto-refreshing tables or grids that may be displayed in tabs but not visible by default. The default behavior of tabs is to render all the tabs but hide them when not show.
New-UDTabContainer -Tabs {New-UDTab -Text "Tab 1" -Content {New-UDElement -Tag 'div' -Content { "Tab 1 Content"}}New-UDTab -Text "Tab 2" -Content {New-UDElement -Tag 'div' -Content { "Tab 2 Content"}}New-UDTab -Text "Tab 3" -Content {New-UDElement -Tag 'div' -Content { "Tab 3 Content"}}} -RenderWhenActive
To load content when the dashboard is loaded by the end user, is the -Dynamic
switch.
New-UDTabContainer -Tabs {New-UDTab -Text "Tab 1" -Content {New-UDElement -Tag 'div' -Content { "The date is: $(Get-Date)"}} -DynamicNew-UDTab -Text "Tab 2" -Content {New-UDElement -Tag 'div' -Content { "Tab 2 Content"}}New-UDTab -Text "Tab 3" -Content {New-UDElement -Tag 'div' -Content { "Tab 3 Content"}}}