I'm attached to the nice blue colour of the PowerShell window when you launch it from one of the pre-installed shortcuts. However, if you manually launch powershell.exe, you don't get these colours, you get black/white :(
This is because the default settings are set on the shortcut (.lnk) file:
I've got a "PowerShell Prompt Here" entry in Explorer context menu, and I'd like it to launch PowerShell using the same nice colours as the usual shortcut; black sucks, and it's confusing to have different coloured windows (especially when I have some old-school command windows open frequently that are also black!).
I've found two problems with trying to set this so far:
- Setting the colour from within PowerShell seems to only allow certain values (ConsoleColor enum), none of which match the one on the default shortcut.
- Setting the colour within the PS Profile causes only text written afterwards to honour the new background colour. Adding "cls" causes a nasty flash of the original colour as it starts.
Is there any way to launch PowerShell from a command line (ie. that I can embed in the registry as an Explorer context menu item) that will use the same settings as the shortcut?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…