Colors Become Even More Important in the New ISE Editor

by Dec 19, 2012

When you type in code into the new PowerShell 3.0 ISE editor, your code is not just "colorful". You may know that each color stands for a specific element, so variables are red and operators are gray. These colors can help you prevent errors when you watch the colors closely. For example, both most operators and cmdlet parameters start with a "-", but parameters are always dark blue so you know they belong to some cmdlet.

Also, try typing in this:

'Your profile script is here: $profile'

ISE will colorize this brown, so you know PowerShell views all of it as a text string. Which is correct and the reason why the $profile variable isn't expanded. Once you change the quotes, all works fine, and the colorization changes again:

"Your profile script is here: $profile"

This time, $profile remains red inside the brown text. It indicates that it is still viewed as a variable and treated accordingly.

So in PowerShell 3.0, color highlighting has risen to new standards, and it can help a lot to appreciate and acknowledge what it wants to tell you.

Twitter This Tip! ReTweet this Tip!