{"id":6801,"date":"2008-01-19T17:09:00","date_gmt":"2008-01-19T17:09:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2008\/01\/19\/block-comments\/"},"modified":"2019-02-18T13:16:17","modified_gmt":"2019-02-18T20:16:17","slug":"block-comments","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/block-comments\/","title":{"rendered":"Block Comments"},"content":{"rendered":"<p><span style=\"background-color: #ffff00\">&lt;Update 01\/04\/2012: This post was written in 2008, when PowerShell was in version 1. Block comments <a title=\"were introduced in Version 2\" href=\"http:\/\/blogs.msdn.com\/b\/powershell\/archive\/2008\/06\/14\/block-comments-in-v2.aspx\"><span style=\"background-color: #ffff00\">were introduced in Version 2<\/span><\/a>.&gt;<\/span><\/p>\n<p>One of the raging debates that have had within the team is the issue of whether to support block comments.&nbsp; In PowerShell, we have the comment character #&nbsp; e.g.<\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\"># This is a test <br \/>get-Process -Name LSASS # you can put a comment at the end of a line too<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>There are times when you have a large set of lines that you need to comment out (e.g. code in progress, cutting out code to test something, function headers, etc).&nbsp; Some believe that we should support a block comment model like C.&nbsp; e.g.<\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">\/* <br \/>Now <br \/>is <br \/>the <br \/>time <br \/>to <br \/>use <br \/>PowerShell <br \/>*\/<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>so you don&#8217;t have to put a # in front of every line:<\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\"># Now <br \/># is <br \/># the <br \/># time <br \/># to <br \/># use <br \/># PowerShell<\/span> <\/p>\n<p>Now you can join the debate.&nbsp; The connect database has a bug filed on this that you can vote on or comment on.&nbsp; <a href=\"https:\/\/connect.microsoft.com\/feedback\/ViewFeedback.aspx?FeedbackID=319307&amp;SiteID=99\">https:\/\/connect.microsoft.com\/feedback\/ViewFeedback.aspx?FeedbackID=319307&amp;SiteID=99<\/a><\/p>\n<p>Let us know what you think.<\/p>\n<p>If you need help knowing what to think, let me know and I&#8217;ll tell you.&nbsp; \ud83d\ude42<\/p>\n<p>Jeffrey Snover [MSFT] <br \/>Windows Management Partner Architect <br \/>Visit the Windows PowerShell Team blog at:&nbsp;&nbsp;&nbsp; <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a> <br \/>Visit the Windows PowerShell ScriptCenter at:&nbsp; <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;Update 01\/04\/2012: This post was written in 2008, when PowerShell was in version 1. Block comments were introduced in Version 2.&gt; One of the raging debates that have had within the team is the issue of whether to support block comments.&nbsp; In PowerShell, we have the comment character #&nbsp; e.g. # This is a test [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6801","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>&lt;Update 01\/04\/2012: This post was written in 2008, when PowerShell was in version 1. Block comments were introduced in Version 2.&gt; One of the raging debates that have had within the team is the issue of whether to support block comments.&nbsp; In PowerShell, we have the comment character #&nbsp; e.g. # This is a test [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/6801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=6801"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/6801\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=6801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=6801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=6801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}