So I've added this to the end of the script:
ConvertTo-HTML | Out-File "C:\Users\test.html"
I see the right output on the console, but the html file is empty:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML TABLE</title>
</head><body>
<table>
</table>
</body></html>
I'm sure I'm missing something