26

I have a strange problem on my laptop - when I run Powershell within an existing console window, the font choice for the window changes.

For example, this is cmd.exe immediately after opening the window: command console when opened

The fonts, window size and colours used are correct - the font is Lucida Console at 16pt.

Then, I run PowerShell and this is the result:

enter image description here

The font has changed to "Raster Font" at 12x16 pixels! Other window properties - colours, row count, column count - are unchanged.

Any idea why it switches?

Note: while researching this - because the Raster Font is horrendously ugly and it bugs me - I have found others reporting problems setting the font for the powershell console window (such as the question "Cannot change powershell default font to Lucida Console"). Though my problem is different (since I'm starting Powershell from an existing console window, not from the start screen), I suspect a solution for one might help the other.

Bevan
  • 2,913

2 Answers2

10

For me it was because the batch file was in UTF-8 (needed that for accent and special char).
What I did was to change the code-page to 437 right before starting the command.

chcp 437 > nul
Powershell.exe -executionpolicy unrestricted -File  X:\Scripts.ps1
Io-oI
  • 9,237
3

I was having the exact same problem and it was driving me nuts. Here is what I did to correct it, hopefully it will work for you too:

  1. While in cmd.exe, run the powershell command.

  2. While at the powershell prompt in cmd.exe, go to the settings and change the font to Lucida Console.

  3. Exit the powershell prompt and while still in cmd.exe go to the settings and change the font to Lucida Console.

  4. As an extra step for good measure I ran start powershell from cmd.exe and changed the font there also.

  5. Smile now that my OCD is able to take a rest. Now when I go to start -> run -> cmd.exe and use the powershell command, it stays at Lucida Console.

I restarted the computer and reopened everything, and so far it seems to be sticking for me.

I hope that this helps you on your quest =)

phuclv
  • 30,396
  • 15
  • 136
  • 260
Ozzy S
  • 342