0
votes

I'm wondering why the background of the PowerShell is different when I open it from Run (or Start) and from the shortcut on desktop PowerShell.exe. In the first case the background is blue, in the latter case it's black.

Are there other differences between the two windows of the PowerShell?


EDIT enter image description here enter image description here


EDIT 2: in the figure below you can see the powershell processes. Moreover, if I open powershell.exe directly from C:\Windows\System32\WindowsPowerShell\v1.0, the background is blue instead of black (remember that its link on desktop opens a black background powershell).

Regarding the below figure, both processes powershell.exe and Windows PowerShell are located in C:\Windows\System32\WindowsPowerShell\v1.0.

P.S.: the situation described here is the same on Windows 10 and 7.

enter image description here


EDIT 3 enter image description here enter image description here

If I go in the folder C:\Windows\System32\WindowsPowerShell\v1.0 and I right click on powershell.exe, there isn't the tab Colours, but its link on Desktop has the tab Colours.

1
It's the same, it's just the color. You should check out the new terminal (by microsoft), it's a lot nicer windows terminalninMonkey
I suspect the shortcut doesn't point to powershell.exe, but is a shortcut to the command prompt cmd.exeTheo
Hello @Theo see the edit pleaseGennaro Arguzzi

1 Answers

1
votes

Are there other differences between the two windows of the PowerShell?

Probably yes but it's likely to be on the same level. (e.g. from your screenshot the blue console is wider so probably has a higher Width layout setting).
afaics it looks they're both the same powershell.exe with different host settings. But only you can confirm.

How to check if they're the same "PowerShell"

  • Open Task Manager > Details tab.
    You should see 2 processes with name powershell.exe.
  • Right click > Properties and look at the Location
    I suspect they're both C:\Windows\System32\WindowsPowerShell\v1.0

Why is one black and the other blue?

  • Right click on desktop shortcut > Properties > Colours
    These settings are applied when you open PowerShell using this shortcut.
  • You can do the same for the Windows PowerShell shortcut in the start menu.
    (You may have to right click > Open file location to get to the actual shortcut)
  • For Run > powershell.exe, it's using the settings in the registry as described here.

Edit: So running the powershell.exe directly uses the settings stored in the registry at path HKEY_CURRENT_USER\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe. Copying and pasting a shortcut does not copy these settings because they are not stored in the exe. I believe but am I not certain that shortcuts will use the settings in HKEY_CURRENT_USER\Console\ by default. You need to edit the properties to change the settings for the shortcut. You could edit them in the registry but this seems like a bad idea as it's not just used by PowerShell.


Related stuff

  • You can change the defaults in the Properties above.
  • Options, Font and Layout settings may also differ.
  • You can see the values for the current console (including run > powershell.exe) by clicking on the PowerShell logo in the top left and going to Properties
  • related links: $Host, Get-Host and (if using PSReadLine module) Get-PSReadLineOption, Set-PSReadLineOption