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

Show parent comments

3

u/MadBoyEvo Apr 03 '19
    $ConditionalFormatting = @(
        [PSCustomObject] @{ Name = 'ColumnName'; Type = 'gt'; Value = 'something'; Color = 'Red'; BackgrounddColor = 'Green' }
        [PSCustomObject] @{ Name = 'ColumnName'; Type = 'gt'; Value = 'something'; Color = 'Yellow'; BackgrounddColor = 'Green'  }
        [PSCustomObject] @{ Name = 'ColumnName'; Type = 'gt'; Value = 'something'; Color = 'Green'; BackgrounddColor = 'Green'  }
    )

That will look like this, more or less.

2

u/Tonedefff Apr 03 '19

Awesome! Just what I was thinking of. I monitor offline servers, stopped Windows services, event log errors, failed backups, etc., and don't want to create a ticket for every single event, so it helps to be able to easily spot problems with colors (like a server going offline 3+ times in one day).

3

u/MadBoyEvo Apr 03 '19

Actually, I have thought about it and here's how it looks;

$Process = Get-Process | Select-Object -First 30
$Process1 = Get-Process | Select-Object -First 5
$Process2 = Get-Process | Select-Object -First 10

Dashboard -Name 'Dashimo Test' -FilePath $PSScriptRoot\DashboardEasy.html {
    Tab -Name 'First tab' {
        Section -Name 'Test' {
            Table -DataTable $Process {
                TableCondition -Name 'ID' -Type number -Operator gt -Value 16000 -Color BlueViolet -Row
                TableCondition -Name 'PriorityClass' -Type string -Operator eq -Value 'Normal' -BackgroundColor Gold
                TableCondition -Name 'PriorityClass' -Type string -Operator eq -Value 'Idle' -BackgroundColor Gold -Color Green
            }
        }
        Section -Name 'Test2' {
            Panel {
                Table -DataTable $Process1 {
                    TableCondition -Name 'HandleCount' -Type number -Operator lt -Value 200 -Color MidnightBlue
                }
            }
            Panel {
                Table -DataTable $Process1
            }
        }
        Section -Name 'Test3' {
            Table -DataTable $Process {
                TableCondition -Name 'HandleCount' -Type number -Operator lt -Value 200 -BackgroundColor MidnightBlue -Color White
            }
        }
    }
    Tab -Name 'second tab' {
        Panel {
            Table -DataTable $Process2
        }
        Panel {
            Table -DataTable $Process2
        }
        Panel {
            Table -DataTable $Process2
        }
    }
}

Does this make sense? Easy to use? Intuitive?

2

u/Tonedefff Apr 03 '19

Yeah that looks a lot better!