HTML
PowerShell includes the ConvertTo-Html
command, which can generate HTML content.
You can create more complex HTML documents using the PSWriteHtml
module available in the PowerShell Gallery, which uses a Domain-Specific Language (DSL) to describe HTML documents in PowerShell.
What is a Domain-Specific Language?
A Domain-Specific Language or DSL is a specialized language used to describe something, in this case, an HTML document. Keywords are used to describe individual elements of the document. In this case, those keywords are hierarchically arranged.
Other DSLs frequently used in PowerShell include Desired State Configuration (DSC) and Pester.
ConvertTo-Html
ConvertTo-Html
generates an HTML document with a table based on an input object. The following example generates a table based on the output from Get-Process
:
Get-Process | ConvertTo-Html -Property Name, Id, WorkingSet
The preceding code generates a table format by default...