PowerShell tips and tricks.
Whenever I learn something new in PowerShell (and I find the time), I record it here, so that later, not only I but you also can find it and benefit.
Thursday, July 19, 2012
Auto-Indenting in PowerShell ISE
Just learned a very amazing thing about the PowerShell ISE (including from PS2)! If one selects multiple lines, then pressing tab will indent them all. Pressing shift+tab will un-indent them all.
This is so wonderful! I don't know how many times over the last year I added an if or try block, and I either manually spaced all the lines or just left it alone. Now, it takes two seconds, and my code looks amazing!
Aha, nice one, cheers! Knew about using TAB on multiple lines, but got stuck when inserting a large chunk of heavily intended code that needing reverse indenting, so this just saved me a lot of hassle!
Aha, nice one, cheers! Knew about using TAB on multiple lines, but got stuck when inserting a large chunk of heavily intended code that needing reverse indenting, so this just saved me a lot of hassle!
ReplyDeleteI have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog!
ReplyDeletescrews Ireland