How do I set the PowerShell default font to Consolas?
I would like to have the Consolas font set as default for PowerShell on Windows 7, no matter how I launch it.
I've found very few explanations on the web for doing this, and none were really clear to me.
Well, according to this question, PowerShell is started by a shortcut which normal user can't modify (it was my case).
I right-clicked the shortcut, then clicked on its "font" tab. That time, when trying to change the font, I got the "access reserved to administrator" dialog, allowing me to change the shortcut.
Unfortunately, it wasn't enough, as a subsequent launch reverted to the default font.
Is there another method of setting a default font?
Well, according to this question, PowerShell is started by a shortcut which a normal user can't modify (it was my case).
I right-clicked the shortcut, started PowerShell as administrator, and then changed the font. Afterwards, the Consolas font was effectively set as the default.
Practical tips (I've written some of them because it depends on how you launch PowerShell):
If PowerShell is being launched by the Start → Run command, you may be able to edit the HKCU\Console\xxx key, where xxx is something like %systemroot%...powershell.exe. Just rename the key and test.
If PowerShell is being launched by a shortcut (like when you pin an item to taskbar, or in Start Screen (Windows 8), you must edit the shortcut. To inherit default configuration, I'd recommend you to create another one, log in as administrator, move it to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\System Tools folder, delete the original shortcut, and rename yours. Then open it and pin into your taskbar if you want.
If you don't have write access to the folder above, just create the shortcut in Desktop, for instance, and pin it. The effect is almost the same.
With PowerShell.exe Microsoft did not allow setting the font type through commands, otherwise you could add this to your profile. All you can do is what @surfasb mentioned by setting it through the window properties. If you are working with the ISE though, there are options to set the font by looking at $psISE.Options
.
You can change the default font to Consolas (though sadly not to Lucida Console), but you'll need to get an administrator to change the permissions on the shortcut first to give users the right to modify the shortcut.
Taking a hint from an earlier @Grawity comment, you'll notice when you open up Powershell that the window options (Ctrl Alt Space ) that the options are similar to the Console window.
So click on default and you can change the options.