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

0

u/[deleted] Apr 08 '19

[deleted]

2

u/MadBoyEvo Apr 08 '19
Install-Module PSWriteExcel
ConvertTo-Excel -DataTable $YourObjeect -FilePath ... -ExcelWorkSheetName ... -AutoFit -AutoFilter

0

u/[deleted] Apr 08 '19

[deleted]

2

u/MadBoyEvo Apr 08 '19

Which HTML? if you don't provide Dashboard with -FilePath it will return HTML. You can always do $HTML = Dashboard {} if needed.

0

u/[deleted] Apr 08 '19

[deleted]

2

u/MadBoyEvo Apr 08 '19

Eh :-)

ConvertTo-Excel -DataTable $ActiveUsers -FilePath ".\DASH\test.xlsx" -ExcelWorkSheetName 'test' -AutoFit -AutoFilter

You either use Dashimo or you usee ConvertToExcel.

Dashboard -Name 'Active users' -FilePath 'Dashimo.html' {
   tab -name 'Active users' {
      table -DataTable $ActiveUsers
   }
}

ConvertTo-Excel -DataTable $ActiveUsers -FilePath ".\DASH\test.xlsx" -ExcelWorkSheetName 'test' -AutoFit -AutoFilter

This gives you 2 files XLSX and HTML at the esame time.

0

u/[deleted] Apr 10 '19

[deleted]

1

u/MadBoyEvo Apr 10 '19

As with any CSV you can do $Object = Import-Csv -Path $YOurCSV and then do whatever you want with that object. Be it $Object | Out-HtmlView or in full blown Dashimo it should work.

0

u/[deleted] Apr 11 '19

[deleted]

1

u/MadBoyEvo Apr 11 '19

What doesn't work? What information do you get? Did you update PSWriteHTML ? (Install-Module PSWriteHTML -Force, close powershell and open it up)? Out-HtmlView was released recently.

→ More replies (0)