PowerShell offers a number ways to export data, one of the easiest to read is in an HTML file. The ConvertTo-HTML cmdlet allows you to export your data requests to a portable HTML file.
In the following examples I am going to take one of the previous commands we looked at in an earlier PowerShell article called Get-Process which lists all processes running. We are going to pipe the output from that command to the ConvertTo-HTML cmdlet and specify a location to save it to.
Get-Process | ConvertTo-HTML | Set-Content c:\process-report.html
We can take this one step further and sort the table so it is a little easier on the eyes.
Get-Process | ConvertTo-HTML name, path | Set-Content c:\process-report.html
Finally we can add a title with the -title switch.
Get-Process | ConvertTo-HTML name, path -title "Process List" | Set-Content c:\process-report.html
Go ahead and try it!