Power Shell script to Make the Output as HTML File

I have a code which find the oldest file in a set of folders and is working fine with the loops and what the issue over here is if i want to make the final Output to be displayed in a HTML file not by converting just by adding the output as a table its not reflecting.

Thanks
Prabakar M

It all depends on your code and what you’re trying to do, but you can either create the HTML in your script and dump it to a file or you can use the ConvertTo-HTML cmdlet. See this TechNet article or go to the Free eBooks link under the Resources tab at the top of this page and grab the “Creating HTML Reports in PowerShell” book.