<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx</link><description>Let me combine a couple of things. 1) When I posted my PowerShell_ISE profile, I included a function Goto-Line that is now builtin to the ISE so I reposted the blog with this function commented out. I commented it out instead of deleting it because I</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx#9258809</link><pubDate>Wed, 31 Dec 2008 22:01:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9258809</guid><dc:creator>Bernd Kriszio</dc:creator><description>&lt;p&gt;Hello Jeffrey,&lt;/p&gt;
&lt;p&gt;attention, block comments do not nest. Included &amp;nbsp;block ends must be escaped or the first one would finish the comment prematurely. &lt;/p&gt;
&lt;p&gt;In &lt;a rel="nofollow" target="_new" href="http://pauerschell.blogspot.com/2008/12/ise-blockcomment-blockuncomment-custom.html"&gt;http://pauerschell.blogspot.com/2008/12/ise-blockcomment-blockuncomment-custom.html&lt;/a&gt; I show a function that works this way.&lt;/p&gt;
&lt;p&gt;The ways for escape are not unique. Perhaps it would help, if you propose some convention. This moment I prefer `#&amp;gt; .&lt;/p&gt;
&lt;p&gt;By the way many thanks for the excellent syntax coloring in ISE.&lt;/p&gt;
&lt;p&gt;Happy new year&lt;/p&gt;
&lt;p&gt;Bernd&lt;/p&gt;
&lt;p&gt;bkriszio@googlemail.com&lt;/p&gt;</description></item><item><title>re: PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx#9258913</link><pubDate>Wed, 31 Dec 2008 23:55:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9258913</guid><dc:creator>Andy Schneider</dc:creator><description>&lt;p&gt;Hi Bernd, good to see you over here. I was just going to mention I had come up with roughly the same thing at &lt;a rel="nofollow" target="_new" href="http://get-powershell.com/2008/12/29/ise-comment-out-a-block-of-text/"&gt;http://get-powershell.com/2008/12/29/ise-comment-out-a-block-of-text/&lt;/a&gt; and that you had mentioned you didn't like the multi-line quote. It's a small world :)&lt;/p&gt;</description></item><item><title>re: PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx#9258998</link><pubDate>Thu, 01 Jan 2009 01:28:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9258998</guid><dc:creator>BooRadley</dc:creator><description>&lt;p&gt;Wicked cool, I've been wanting this.&lt;/p&gt;</description></item><item><title>re: PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx#9259083</link><pubDate>Thu, 01 Jan 2009 03:02:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9259083</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;&amp;gt; Wicked cool&lt;/p&gt;
&lt;p&gt;What are you from Mass?&lt;/p&gt;
&lt;p&gt;Wait .. &amp;nbsp;no... that would have been &amp;quot;wicked pissa cool&amp;quot; - never mind.&lt;/p&gt;
&lt;p&gt;:-)&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Windows Management Partner Architect&lt;/p&gt;
&lt;p&gt;Graduate of Chelmsford (Mass) High School&lt;/p&gt;
</description></item><item><title>re: PowerShell_ISE Scripting: ConvertTo-Comment</title><link>http://blogs.msdn.com/powershell/archive/2008/12/31/powershell-ise-scripting-convertto-comment.aspx#9262255</link><pubDate>Thu, 01 Jan 2009 20:20:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9262255</guid><dc:creator>David Mohundro</dc:creator><description>&lt;p&gt;Building on Bernd Kriszio's comment here and at Andy's blog, here's a Toggle Commenting menu item (with Ctrl+/ being the hotkey):&lt;/p&gt;
&lt;p&gt;function ISE-CommentSelectedText {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$text = $psise.CurrentOpenedFile.editor.SelectedText&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$lines = $text.Split(&amp;quot;`n&amp;quot;) | %{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$_ -replace &amp;quot;^&amp;quot;, &amp;quot;# &amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if ($lines[$lines.count -1] -eq &amp;quot;# &amp;quot;) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$lines[$lines.count -1] = &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$text = [string]::join(&amp;quot;`n&amp;quot;, $lines)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$psise.CurrentOpenedFile.editor.InsertText($text)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;function ISE-UncommentSelectedText {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$text = $psise.CurrentOpenedFile.editor.SelectedText&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$lines = $text.Split(&amp;quot;`n&amp;quot;) | %{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$_ -replace &amp;quot;^ *# *&amp;quot;, &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$text = [string]::join(&amp;quot;`n&amp;quot;, $lines)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$psise.CurrentOpenedFile.editor.InsertText($text)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;function ISE-ToggleCommenting {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if ($psISE.CurrentOpenedFile.Editor.SelectedText.StartsWith('#')) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ISE-UncommentSelectedText &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;else {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ISE-CommentSelectedText&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;$psISE.CustomMenu.Submenus.Add('Comment/Uncomment', {ISE-ToggleCommenting}, &amp;quot;Ctrl+Oem2&amp;quot;)&lt;/p&gt;</description></item></channel></rss>