ISE – Comment out a block of text
December 29, 2008 at 10:12 AM
In a comment in an earlier post, reader Bernd asks the following question:
Now I'm guessing if there is a way to use $psise.CustomMenu to add CommentBlock and UnCommentBlock commands.
One way to tackle this would be the following.
$text = $psise.CurrentOpenedFile.editor.SelectedText
$psise.CurrentOpenedFile.editor.InsertText("<# $text #>")
Once you have this you can wrap it in a function and use Custom Menus to create a “Comment Block” Menu item.
Hope this helps.