I have done what you seem to be asking. Here is my $.02.
In my case, I was creating a digital signature via the Canvas element and saving that image/signature to a file. The HTML page was created from a PowerShell script and then opened in IE. The reason I chose to open in IE is that IE/EDGE are the only browsers that seem to honor your admin privileges on the system in that if you want to save the file to a restricted folder (limited to admins only which was my case), only IE/EDGE would honor those permissions. Chrome/FF did NOT.
Not sure exactly what you want to save but if you want to save HTML content, it looks like you need to use the Blob object.
As for building your HTML from PowerShell, can you show what you have tried? In my case, I built the page with what I call brute force and then added table content using PowerShell ConvertToHTML.