How to Change Windows PowerShell Color Scheme in Windows 10 1

How to Change Windows PowerShell Color Scheme in Windows 10

The first Windows PowerShell was released over a decade ago for Windows XP, Windows Server 2003, and Windows Vista. Since then, it has been an integral part of all versions of Windows, starting with Windows 7 in 2009. While many changes have been made to the software itself, the only thing that has remained unchanged over the years is the color scheme – a blue background. white/yellow text in general and red text on a black background for error messages. While most people are used to these colors, some of you may want something more distinctive for better visibility or aesthetic reasons. In that case, let’s take a look at how you can change the Windows PowerShell color scheme in Windows 10:

Note: Before continuing, it is important to understand that this particular tutorial will deal with the PowerShell console, not the PowerShell ISE, which is one of the two host applications for the Windows PowerShell engine and language. It has its own customization settings that should be covered separately and is beyond the scope of this tutorial.

Change Background and Foreground Colors in Windows 10 PowerShell Console

  • As mentioned earlier, the Windows PowerShell console by default displays white on blue and red on black for error messages, so to change the colors, Right click on the top bar of the PowerShell Window and select ‘Properties’.

  • When the Windows PowerShell ‘Properties’ box opens, Click on the ‘Colors’ taband you will have a number of options to set the background and foreground colors as seen in the screenshot below.

How to Change Windows PowerShell Color Scheme in Windows 10

From here change text colors, dropdown text colors, background colors and even adjust opacity levels.

Change Error Message Colors in Windows 10 PowerShell Console

  • While this is a really easy way to change some settings, what if you want to make more extensive changes to your PowerShell console? For example, if I want to change the text and background colors of error messages something a little less harsh than red on black? For that, you’ll have to go down and dirty and use the console itself rather than relying on the GUI. First, go ahead and copy/paste this code into the PowerShell console to find out the default colors and hit the ‘Enter’ key: $host.privatedata

How to Change Windows PowerShell Color Scheme in Windows 10

  • To change the foreground and background colors of error messages, all you have to do is assign new values. Since I want to change the background color to ‘Magenta’ and the foreground color to ‘Green’ I will enter the following two commands. just remember enter them separately and press ‘Enter’ in each case.
    $host.PrivateData.ErrorBackgroundColor = "Magenta"

    $host.PrivateData.ErrorForegroundColor = "Green"

How to Change Windows PowerShell Color Scheme in Windows 10

  • You have now configured your console settings, but you will need save them in profile settings so the screen pops up exactly the way you want it, every time. For this, first run the command $profile. This will show you the name (and location) of the default file for your profile.

How to Change Windows PowerShell Color Scheme in Windows 10

  • In reality, default PowerShell config file doesn’t even exist in most cases. So, run the following command to check if it already exists or if you need to create it from scratch: test-path $profile. If the file already exists you will output “True” otherwise you will get “False”.

How to Change Windows PowerShell Color Scheme in Windows 10

  • As you can see from the screenshot above, I got the latter, so I’ll need to create the file. If you get it “correct”, skip this step and move on to the next.. Otherwise, enter the following command to create the file: New-Item -path $profile -type file -force

How to Change Windows PowerShell Color Scheme in Windows 10

  • Easily after the file is created Edit with Notepad using notepad $profile command in the Powershell Window. From here, you can add any configuration code you want using the commands discussed above. With this method you can change not only colors but also fonts, window size etc. You can change it too, but we’re just going to take a look at changing colors without complicating things any further.

    $console = $host.ui.rawui
    $console.backgroundcolor = "black"
    $console.foregroundcolor = "white"
    $colors = $host.privatedata
    $colors.verbosebackgroundcolor = "Magenta"
    $colors.verboseforegroundcolor = "Green"
    $colors.warningbackgroundcolor = "Red"
    $colors.warningforegroundcolor = "white"

    $colors.ErrorBackgroundColor = "DarkCyan"
    $colors.ErrorForegroundColor = "Yellow"
    set-location C:\
    clear-host

How to Change Windows PowerShell Color Scheme in Windows 10

  • We’re almost there, but there’s one last step left. run the following command for allow local scripts to run on your system: Set-ExecutionPolicy RemoteSigned and Choose “A” to allow all scripts. Now when you’re done, this is what your PowerShell console will look like every time you launch it. Even error messages appear a little less annoying than they normally would.

How to Change Windows PowerShell Color Scheme in Windows 10

That’s it folks, I made the Windows PowerShell console on my work laptop look almost exactly like the old Command Prompt with a pinch of color thrown in for fun.

Note: While the steps mentioned above are specifically for Windows 10, I also tried them on our old Dell desktop running Windows 7. Every step is pretty much the same and everything worked as expected.

SEE ALSO: How to Stop Automatic Installation of Windows 10 Updates

Use Simple Commands to Change Windows PowerShell Colors in Windows 10

Windows PowerShell is a great tool for power users, but that doesn’t mean it has to be boring, boring, and boring. Making minor changes to a few settings here can make a world of difference to the way your PowerShell console looks, so give it a try and change the colors according to how your heart feels. Once you’ve done that, don’t forget to let us know how things are going, because we love to hear from you.

Support our work ❤️

If you enjoyed this article, consider leaving a tip to help us keep publishing great content.

Secure payment on PayPal
Moyens I/O Staff is a team of expert writers passionate about technology, innovation, and digital trends. With strong expertise in AI, mobile apps, gaming, and digital culture, we produce accurate, verified, and valuable content. Our mission: to provide reliable and clear information to help you navigate the ever-evolving digital world. Discover what our readers say on Trustpilot.