Setting Powershell colors with hex values in profile script

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

You can, but not via the $Host object. The color table is stored in the registry.

You would use the same names, but the colors would be different. That's why the default PowerShell console is blue/gray.


I doubt that's possible. The $Host.UI.RawUI.BackgroundColour is a System.ConsoleColor enumerator, thus there's only a finite set of colours that you could select. http://msdn.microsoft.com/en-GB/library/system.consolecolor.aspx