This topic contains 3 replies, has 3 voices, and was last updated by
January 5, 2016 at 6:41 am #33484ParticipantTopics: 3Replies: 10Points: 0Rank: Member
I know that it is possible but i do not remember the keyboard shortcut in ISE to highlight an area of code and create a comment block or Comment out all the lines.
Any help for my failing memory would be helpful
the desired result is being edited out. Simply I am seeking the keyboard shortcut to comment out multiple lines
January 5, 2016 at 6:46 am #33485MemberTopics: 9Replies: 2322Points: 0Rank: Member
I don't believe there is a "comment block of code" function in the ISE by default. However, there is a "block select" functionality in the ISE which allows you to type on multiple lines at once. To do that, put your cursor at the start of the first line. Then, while holding Alt + Shift, use your down arrow to move the cursor down to the last line you want to comment. (You're actually block-selecting multiple lines, zero columns). Then just type "# " to inject the hash and space at the beginning of those lines.
If you wanted to get rid of those comments, you can use Alt+Shift while selecting all of the "# " characters on each commented line, and then you get rid of them all with one press of Backspace or Delete.
January 5, 2016 at 8:28 am #33497ParticipantTopics: 4Replies: 104Points: 82Rank: Member
If you have the ISESteroids module loaded, it provides Ctrl+Shift+B as a keyboard shortcut for toggling block comments. However a bug in PowerShell 5.0 prior to build 10586 prevents it from working (atleast on Windows 10).
January 8, 2016 at 4:52 am #33653ParticipantTopics: 3Replies: 10Points: 0Rank: Member
Thank you both. I had seen it used on a you tube presentation that I had watched and they said that Steroids was not needed. @dave Wyatt that will serve the purpose that I am looking for.
I appreciate both of you for your feedback.
The topic ‘Keyboard Shortcut to create a comment block’ is closed to new replies.