r/PowerShell • • Apr 02 '19

Dashimo - PowerShell Generated HTML Dashboard in a single file

Something that may come useful to you guys. Recently I've written Dashimo which allows creating HTML dashboards in a very easy, intuitive way. With it, you no longer have to build an object and then play with HTML to get it to display correctly in HTML.

The whole idea with screenshots is described in my blog.

https://evotec.xyz/meet-dashimo-powershell-generated-dashboard/

Dashimo generates a single HTML file that you can attach to email or host on a website. There is no DB or anything else. Keep in mind this can't be used as Email Content because it holds JS and heavy CSS. But you can attach it to email and the features it holds within that HTML are well worth it.

On my blog, I'm explicitly showing it using my Active Directory module but you can pass anything to Table. Even $Object = Get-Process if you really want to.

Dashboard -Name 'Dashimo Test' -FilePath $PSScriptRoot\Dashboard.html {
    Tab -Name 'Forest' {
        Section -Name 'Forest Information' -Invisible {
            Section -Name 'Forest Information' {
                Table -HideFooter -DataTable $DataSetForest.ForestInformation
            }
            Section -Name 'FSMO Roles' {
                Table -HideFooter -DataTable $DataSetForest.ForestFSMO
            }
        }
   }
} 

The easiest sample looks like this.

$Process = Get-Process | Select-Object -First 30

Dashboard -Name 'Dashimo Test' -FilePath $PSScriptRoot\Dashboard1.html {
    Section -Name 'Test' {
        Table -DataTable $Process
    }
}

You can have as many sections/panels as you need. Tabs also work just fine. Charts are coming sometime soon.

130 Upvotes

90 comments sorted by

View all comments

2

u/KDRIUP Apr 03 '19 edited Apr 17 '19

This is pretty slick. I just started to dabble in it using some dbatools commands.

$cpu = Get-DbaCmsRegServer -SqlInstance myCMSserver -group test | Get-DbaCpuUsage
$io = Get-DbaCmsRegServer -SqlInstance myCMSserver -group test | Get-DbaIoLatency
$query = Get-DbaCmsRegServer -SqlInstance myCMSserver -group test | Get-DbaQueryExecutionTime

Dashboard -Name 'DB Health Dashboard' -FilePath c:\dba\ServerHealth.html {
tab -Name 'CPU Usage' {
Table -DataTable $cpu
}
tab -Name 'IO Latency' {
Table -DataTable $io
}

tab -Name 'Query Exectutions' {
Table -DataTable $query
}
}

3

u/MadBoyEvo Apr 03 '19

Loooks... simple ;-)

2

u/Lee_Dailey [grin] Apr 03 '19

howdy KDRIUP,

it looks like you used the New.Reddit.com Inline Code button. it's 4th 5th from the left hidden in the ... "more" menu & looks like </>.

on Old.Reddit.com, the above does NOT line wrap, nor does it side-scroll.

for long-ish single lines OR for multiline code, please, use the Code Block button. it's the 11th 12th one from the left, & is just to the left of hidden in the ... "more" menu.

that will give you fully functional code formatting, from what i can tell so far. [grin]

take care,
lee