March 15th, 2018

PowerTip: Build simple HTML with PowerShell

Doctor Scripto
Scripter

Summary: Here’s how to use the ConvertTo-HTML cmdlet to build basic HTML content.

  Hey, Scripting Guy! Occasionally I need to build basic HTML documents. I heard there was a way to do that with Windows PowerShell.

  There most certainly is! Just use the ConvertTo-HTML cmdlet to save the day! For example:

                          $SampleDoc=@’

                          This is a simple text Document in PowerShell

                          That I am going to make into a Tiny web page

                          🙂

                          ‘@

                          ConvertTo-Html -InputObject $SampleDoc

              

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • AlanW

    what is the exact explanation on how to get the command which is ConvertTo-Html -InputObject $SampleDoc