{"id":82865,"date":"2018-03-15T11:00:31","date_gmt":"2018-03-15T18:00:31","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=82865"},"modified":"2019-02-18T09:09:59","modified_gmt":"2019-02-18T16:09:59","slug":"powertip-build-simple-html-with-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-build-simple-html-with-powershell\/","title":{"rendered":"PowerTip: Build simple HTML with PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Here\u2019s how to use the <strong>ConvertTo-HTML<\/strong> cmdlet to build basic HTML content.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\"><img decoding=\"async\" width=\"34\" height=\"34\" class=\"alignnone size-full wp-image-82735\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" \/><\/a> \u00a0 Hey, Scripting Guy! Occasionally I need to build basic HTML documents. I heard there was a way to do that with Windows PowerShell.<\/p>\n<p style=\"padding-left: 30px\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\"><img decoding=\"async\" width=\"34\" height=\"34\" class=\"alignnone size-full wp-image-82745\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" \/><\/a> \u00a0 There most certainly is! Just use the <strong>ConvertTo-HTML<\/strong> cmdlet to save the day! For example:<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $SampleDoc=@&#8217;<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 This is a simple text Document in PowerShell<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 That I am going to make into a Tiny web page<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \ud83d\ude42<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8216;@<\/p>\n<p style=\"padding-left: 30px\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ConvertTo-Html -InputObject $SampleDoc<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/dr_scripto.png\"><img decoding=\"async\" width=\"96\" height=\"145\" class=\"alignnone size-full wp-image-82775\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/dr_scripto.png\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Here\u2019s how to use the ConvertTo-HTML cmdlet to build basic HTML content. \u00a0 Hey, Scripting Guy! Occasionally I need to build basic HTML documents. I heard there was a way to do that with Windows PowerShell. \u00a0 There most certainly is! Just use the ConvertTo-HTML cmdlet to save the day! For example: \u00a0 \u00a0 [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[639],"tags":[56,356,154,45],"class_list":["post-82865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powertip","tag-guest-blogger","tag-powertip","tag-sean-kearney","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Here\u2019s how to use the ConvertTo-HTML cmdlet to build basic HTML content. \u00a0 Hey, Scripting Guy! Occasionally I need to build basic HTML documents. I heard there was a way to do that with Windows PowerShell. \u00a0 There most certainly is! Just use the ConvertTo-HTML cmdlet to save the day! For example: \u00a0 \u00a0 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/82865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=82865"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/82865\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=82865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=82865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=82865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}