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/motsanciens Apr 03 '19

This is pretty cool. I am playing around with it to show DHCP leases, and the search feature works really well. When I dug into the code, I saw that it has a dependency on the PSWriteHtml module, so I looked at that, and the Table function is an alias for New-HTMLTable, right? But I've tried to include some parameters from that function to display more rows per page, and I haven't gotten it to work. What's the right way to specify that?

3

u/MadBoyEvo Apr 03 '19

I'll get those parameters into Table in next release. There will be also conditional formatting which I already have in testing. If you can't wait I can show you how to fix it in PSWriteHTML. I mean Dashimo is just an intuitive wrapper around PSWriteHTML. I am still not sure how things are supposed to work in PSWriteHTML so things may change drastically from time to time and if that happens I'll simply update Dashimo. Dashimo approach shouldn't change much except for Height parameter which isn't working as I want it.

2

u/motsanciens Apr 03 '19

OK, no worries. Thought maybe I was just not finding what was already there :)

2

u/MadBoyEvo Apr 03 '19
        [int[]]$PagingOptions = @(15, 25, 50, 100),
        [switch]$DisablePaging,

Are the ones you should worry about. -PagingOptions @(50,100,150,200) or simply -DisablePaging shoould solve it.