29. December 2008
Andy Schneider
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.
Andy