I know I can change PowerShell console colors by setting in my profile something like:
$Host.UI.RawUI.BackgroundColor = "White"
Clear-Host
However in the Powershell Console one can go to the Color tab in Properties and modify the RGB values of the standard 16 ANSI colors manually. Is it possible to do set either hex or RGB values of the standard colors from the profile script? For instance setting I would like to have:
$Host.UI.RawUI.BackgroundColor = "#242424" # Gray
Clear-Host
Hex color codes start with a pound sign or hashtag (#) and are followed by six letters and/or numbers. The first two letters/numbers refer to red, the next two refer to green, and the last two refer to blue. The color values are defined in values between 00 and FF (instead of from 0 to 255 in RGB).
Font color is termed as the Foreground color in the PowerShell. To change the font color you can use the console GUI property “Screen Text”. There are various 16 colors available and you can change RGB properties as well.
Copy the ones you want to reset to their default color settings, and paste them in your "C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell" folder. That's it!
The correct way to do this is with the Registry
cd hkcu:/console
$0 = '%systemroot%_system32_windowspowershell_v1.0_powershell.exe'
ni $0 -f
sp $0 ColorTable00 0x00562401
sp $0 ColorTable07 0x00f0edee
With the color being
0x00BBGGRR
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With