Creating HTML Reports with PowerShell Part 4
Before I get to today's content, I want to remind you about subscription management. The best way to manage your subscription is to use the links in the footer of newsletter emails.

One thing to keep in mind is that if you cancel a paid subscription, you immediately lose archive access. If you are on a monthly subscription, you should think of each payment as covering the previous month. If you are a paid subscriber and need to cancel, I recommend waiting until you get a renewal notice and then canceling. If you think you are going to cancel, you might want to save a few emails so you can use the unsubscribe link in the footer. I hate to see people leave, but I understand that sometimes it is necessary.
More Samples
Alright, let's wrap up this series on HTML reporting with a few more samples. These are scripts I have used in the past to generate HTML reports. You are welcome to use them as is or as models for your own reports.
Morning Report
One of the first reporting scripts I wrote all the way back in the PowerShell 2.0 days is the Morning Report script. This script is similar to the system information reports I've been demonstrating. This script lets you generate a status summary of a remote computer or computers. The output can be an HTML report, a text file, or a custom object. You could use the custom object to create your own HTML report or use it in other ways.
The script can create HTML output, but you'll need to save it to a file.
C:\scripts\MorningReport-v7.ps1 -Html -ImagePath C:\scripts\zazu.gif | Out-File c:\temp\mr.html

The file includes navigation links to the various sections of the report.
Download the script from https://gist.github.com/jdhitsolutions/b5b2fcc047cedc252b7f169ffa7e9642
Disk Report
Another HTML reporting option is part of the DiskReportingTools module. This module contains commands for getting and visualizing disk and folder usage. The module also includes a command,New-HTMLDriveReport
, that generates an HTML report of disk usage.
New-HtmlDriveReport -HeadingTitle "Disk Usage Report" -Path c:\temp\du.html

This function can easily process multiple computers and generate a single report.
New-HtmlDriveReport -ComputerName dom1,dom2,srv1,srv2,win10 -Credential $artd -HeadingTitle "Company Drive Report" -ReportTitle "Company Drive" -Path c:\temp\company-drive-report.html

Using pwshSpectreConsole
Another HTML reporting tool you might consider is a command in the pwshSpectreConsole. I've written about this module in the past. The module has an experimental command called Start-SpectreRecording
. This will "record" the output of a PowerShell session. You have the option to save the output as HTML. You can then use ConvertTo-Html
to create the report.
The recording assumes you are going to use other commands from the pwshSpectreConsole module, Here's a brief proof-of-concept script.
#requires -version 7.4
#requires -module pwshSpectreConsole
$start = Start-SpectreRecording -RecordingType html
#parameters for Format-SpectreTable
$tableParams = @{
Border = "Rounded"
Color = "Purple"
HeaderColor = "DodgerBlue3"
Title = "Top 10 Processes - $($env:computername)"
Expand = $true
}
Write-SpectreFigletText -Text "Process Info" -Color green
Write-SpectreHost "Hello, [red]PowerShell World![/]`n"
Get-Process | Sort-Object WS -descending |
Select-Object -First 10 -Property Id, Name,
@{Name="WorkingSet(MB)";Expression = {$_.WS/1MB -as [int]}},
Handles,StartTime,
@{Name="Runtime";Expression = {New-TimeSpan -Start $_.StartTime -End (Get-Date)}} |
Format-SpectreTable @tableParams
$end = Stop-SpectreRecording -Title "SpectreRecording Demo"
$post = @"
Click <a href=https://github.com/ShaunLawrie/PwshSpectreConsole>here</a> to learn more about the pwshSpectreConsole module.
<br>
<h5><i>Recorded $(Get-Date)</i></h5>
"@
$head = @"
<style>
body {
background-color:rgb(235, 223, 223);
padding: 10px;
font-family: Verdana, sans-serif;
font-size: 12pt;
border-radius: 5px;
}
</style>
<Title>SpectreRecording Demo</Title>
"@
$splat = @{
Body = $end
PostContent = "$post"
Head = $head
}
ConvertTo-Html @splat | Out-File c:\temp\psc.html -Encoding utf8
The HTML body is stored in $end
. I am using ConvertTo-Html
to convert the HTML body to a file.

This could be a very useful tool, especially if you want to take advantage of the formatting and display options of the pwshSpectreConsole module. I'm just beginning myself to explore the options and maybe I'll have something to share in the future.
PSHTML
One final option to consider, although it has its own learning curve, is the PSHTML PowerShell module. This module hasn't been update in a while, but the core functionality should still work. This module takes the approach of designing a DSL (domain-specific language) for creating HTML reports. This means you can create a script with keywords like title
, h1
, and link
. All of this is documented https://pshtml.readthedocs.io/en/latest/.
You use the module commands in a script to create your report. Here's an example from the documentation.
Import-Module PSHTML
html {
head{
title "Sample Title"
link "blue.css" "stylesheet"
}
body{
h1 "This is h1 Title in header"
div {
p {
"This is simply a paragraph in a div."
}
h1 "This is h1"
h2 "This is h2"
h3 "This is h3"
h4 "This is h4"
h5 "This is h5"
h6 "This is h6"
strong "plop";"flop"
}
h1 "My favorites Fruits"
$Fruits = "Apple","Banana","Orange","Pineapple"
ul {
foreach($fruit in $Fruits){
li {
$fruit
}
}
}
}
footer {
p{
"Copyright 2025"
}
}
} | Out-File .\pshtml-demo.html

I haven't spent a lot of time with this module, but I did create a simple demo script that you can try.
#requires -version 7.5
#requires -module PSHTML
#get data
$proc= Get-Process | Where WS -ge 250MB | Sort-Object WS -Descending |
Select-Object ID,Name,
@{Name="WorkingSet(MB)";Expression={[math]::round($_.WS/1MB,2)}},
@{Name="Runtime";Expression={New-TimeSpan -Start $_.StartTime -End (Get-Date)}} |
ConvertTo-PSHtmlTable -caption "Top Processes [$($env:COMPUTERNAME)]"
$meta = @"
Generated on $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')<br>
by $env:USERNAME on $($env:COMPUTERNAME)
"@
html {
head{
#embed CSS
style (Get-Content -path c:\scripts\samplecss\blue.css -Raw)
}
body{
h1 "Status Report"
$proc
}
footer {
p{
$meta
}
}
} | Out-File c:\temp\status-demo.html

The module has some interesting graphing features you might want to take advantage of. Check the online documentation.
PSWriteHTML
Just as I was wrapping this article up, a friend pointed me to the PSWriteHTML module. Like the previous module, you can use this to abstract the HTML generation process using PowerShell. This module is under active development and offers a wealth of features. I could probably spend a few articles just on this module.
I strongly encourage you to check out the links on the repository's README page to get a sense of what the module can do. The module is available from the PowerShell Gallery.
Summary
I hope you will find opportunities to try these things out. PowerShell makes it easy to get a wide variety of information. If you can get data from PowerShell, you can then present it in a meaningful and valuable way, such as an HTML report.
Have fun.