On my Windows 7, if i run a powershell via "Win+R", "powershell" it will start with white text on black background and settings are affected via [HKEY_CURRENT_USER\Colors]
. For example, i can easily change the default "red" color to be less bright:
But if i pin this powershell to Windows 7 superbar and start it by clicking superbar icon, it will display some mad blue-and-white colors that i can't change O_O:
Why such difference and is it any way to configure colors of pinned powershell same way i can configure powrshell that is started via "run" command.
Best Answer
TL;DR
powershell.exe is a console program. When a console program runs, Windows configures the console by looking in a bunch of locations.
First it looks at the shortcut (.LNK file) you launched. That's what you'll typically see in the start menu, on the desktop, in the taskbar. If you RClick on the shortcut and select Properties, you'll see a bunch of these options there.
For any options that aren't specified in the shortcut (or if you launched the .EXE directly, without a shortcut), Windows will look in the registry.
I couldn't find a comprehensive list of registry keys involved, but here are the ones I know about:
But wait, there's more!
When you open the System menu on a console window you see both "Properties" and "Defaults".
Defaults modifies one of the above registry keys.
The properties apply to the currently open console window and the shortcut that launched it. If you didn't use a shortcut because you opened the .EXE directly, it goes to a special registry key, instead, like:
But that's not all!
Console programs have the ability to modify their own colors. For example, in CMD you can do:
And in PowerShell:
These settings are not persisted in any way.