Today, I was experimenting with hash tables that had keys with multiple values. (More about that later!) But, in the course of my experimentation, I tried one technique and then another and then another. I didn’t want to delete any of my trial code, but I also didn’t want it to run. I just wanted to comment it out.
I could have typed a comment symbol (#) on each line or typed the “<#” and “#>” to enclose each code block in a comment block, but PowerShell Studio 2014 makes commenting even easier.
To comment out each line individually (#), highlight one or more lines and type Ctrl + Q, or click Comment (in the Edit section of the Home tab).
Here’s the result.
To add a comment block, highlight a code block and type Ctrl + Shift + Alt + Q, or click Block Comment. (The Block Comment icon is new in PowerShell Studio version 4.1.72.)
And, here’s the result.
To delete comments (either format), highlight the commented lines and type Ctrl + Shift + Q, or click Uncomment.
And, they’re gone.
That will save me a few keystrokes and let me concentrate on my hash table.
June Blender is a technology evangelist at SAPIEN Technologies, Inc. You can reach her at juneb@sapien.com or follow her on Twitter at @juneb_get_help.
that’s in reat. Maybe this is not the place, but in ISE you can hold down ALT + Shift. + up/down arrows to mark a position in these lines. Afterwards you can multiline write # (or delete to remove).
That’s a great tip, Anders. Thanks! Not quite as easy, but good to know. 🙂
Nice to see the “Block Comment” feature request finally added to PowerShell Studio. 🙂
I agree, Craig! If there’s ever a feature that you need, be sure to post a request on the forum or just send mail directly to me.
— JuneB
June Blender, juneb@sapien.com, @juneb_get_help
The block feature has always been present, but we just surfaced it on Ribbon.
I knew the keystrokes were there, but as I said back in April, “I like buttons.”