PowerShell: Modern HTML Reports

Overview:

ConvertTo-Html is a cool function built directly into Powershell that allows you to generate simple HTML documents. The keyword there being “Simple” as the default output is a little too plain for my liking. I have always wanted to try and make more modern HTML reports so that I could show various data without it being overwhelming while at the same time highlighting points of interest to bring up in conversations.

Today I published the proof of concept to my GitHub and I would like to show you what I have been working on for the past few months.

The main purpose of the HTML report would be to keep data simple and easy to read for non-technical people and if a more technical review is needed then an accompanying CSV is also created that will allow for a deeper dive into the specifics. Before starting this process I knew very little about HTML, CSS, & JavaScript and now I have progressed to knowing slightly more than very little about HTML, CSS, & JavaScript. 🙂 Really though this took a lot of effort and time and I hope that this proof of concept will help anyone else exploring this path in the endeavors.

Goals for this Project:

  • Goal 1: Create a modern HTML report using PowerShell
  • Goal 2: Reports will not require a webserver
  • Goal 3: Reports should be mobile friendly
  • Goal 4: Reports should be easily adaptable
  • Goal 5: A report should look the same when accessed offline

How-To:

As of 2021-10, this proof of concept gathers the PowerShell version installed on a Windows computer and sends the results to a CSV and or an HTML file. Tested and it works on PowerShell 5+.

  1. Download the GitHub repo
  2. Open PowerShell & run either Get-PSVersion-*.ps1 scripts
\Get-PSVersion-MultiTable.ps1 -Report All -ShowReport
  • Note: Both scripts are identical and the only difference is that the “MultiTable” script shows how a report would look if you generated multiple tables in the same HTML report.
  • [ -Report ] All,CSV, HTML
    • Gives you the option to generate a report in a CSV, HTML, or both.
  • [ -ShowReport ]
    • This opens the report folder located at “C:\Audits\Logs” that is created when the script is run

Example:

Command:

\Get-PSVersion-MultiTable.ps1 -Report All -ShowReport
Example report generated from the Get-PSVersion-MultiTable.ps1 PowerShell script

1 Comment

  1. Pingback: PowerShell: Datto PowerShell Wrapper - Celerium

Leave a Reply