DEV Community

Cover image for Customize ANY color in Windows PowerShell
Sudev Suresh Sreedevi
Sudev Suresh Sreedevi

Posted on

Customize ANY color in Windows PowerShell

Windows PowerShell is one of the most powerful terminals in the Windows Operating System, and yet we are stuck to customizing its colors to those 16 fixed values in the properties menu. Today, we are gonna change that.

Table of Contents

Intro

You might have noticed those RGB controls in the properties menu of PowerShell, where you’d have to individually enter the value of Red, Green and Blue to set a custom color. This process, is rather tedious since you would have to find a color of your liking, find its RGB value, and individually enter those values one-by-one 😖.

The obviously easier method would be to enter the hex value (looks something like #123ABC) of the color and set the color in one go. Unfortunately, such a feature doesn’t exist in PowerShell despite the terminal having the 256-bit color support.

This is where I would like to introduce you to the Project PowerShell HexColor. With this, you can set any color to your PowerShell terminal without having to go through the painful process of entering the RGB values one by one, nor editing the registry. Simply provide a hex value and voila, you can use that color in PowerShell 🌈.

PowerShell Hex Color

Custom Terminal Colors using PowerShell Hex Color (Yes, this is PowerShell)

Custom Terminal Colors using PowerShell Hex Color (Yes, this is PowerShell!)

Project Link: https://github.com/GameGodS3/Powershell-Hex-Color

PowerShell HexColor, tweaks the Windows Registry to register the color values you are providing, so that PowerShell loads them as the default value of those specific colors in the color table.

The only limitation is the fact that PowerShell can still have only a selection of 16 colors at the same time in its color table. But hey, YOU can decide which should be those 16 colors! 🎨

Installation & Usage

To download the script, simply execute the following in PowerShell and then, run the script 😁.

iwr -useb https://raw.githubusercontent.com/GameGodS3/Powershell-Hex-Color/main/hexadjust.ps1 |`
     ni $HOME/Documents/WindowsPowerShell/hexadjust.ps1 -Force
Enter fullscreen mode Exit fullscreen mode

If you do like the project, consider sharing to your friends, and giving the project a star. It would mean a lot to me.

Cheers & Happy Coding!

Sudev Suresh Sreedevi

Top comments (0)