Skip to main content
PowerShell

PowerShell Output as HTML with CSS to make it fancy

By February 25, 2014September 12th, 2022No Comments

You may have seen output from commands that produce HTML files so the reports can look a little fancy. This is possible and not at all difficult with PowerShell. In this video we take a look at the output from Get-Service and creating HTML output with the cmdlet ConvertTo-HTML. This has an option -CSSUri that can conveniently reference a css stylesheet. This could be a local file, on a \windowsshare or http;// url so the options do exist to make this simple for you. The video will step you through the complete process but there really is not that much to making this happen.

gsv | Select Name, Status | ConvertTo-Html -CSSUri c:test.css | out-file test.html