ConsoleExtensions update – now with more colors!

In the latest preview build of Windows 10 (14931) the console have been updated to (finally) support more colors! I have updated my Console Extensions module. Read on to learn about the new features.

Write-RGB

A new function that lets you write to the console with 24-bit color support! I have included a new class that you can use to define your own colors, or you can use one of the 132 colors I have included in the ‘colors’ variable.

2016-09-26_19h21_50

To be able to define your own colors with the new class, you need to write ‘using module Communary.ConsoleExtensions‘ to get access to it. If you want to include this in the profile, remember that using statements need to be at the top, before anything else.

Colorized file listings

If you don’t want to use the dedicated Invoke-ColorizedFileListing function, I have included a custom formats file, inspired by Joel Bennett, that gives you color when using Get-ChildItem. On top of that, if you have the preview build you get access to 24-bit colors here as well. The colors are customizable through a new global variable – ‘psFileColors‘. On top of that, if you have the PowerShellHumanizer module installed, you can enable humanization of the date and file size fields.  This is controlled by the global variable ‘psFormatsOptions‘.

2016-09-26_19h30_06

2016-09-26_19h33_04

On top of this, Reparse Point targets are shown in the file listing.

2016-09-26_19h31_19

Custom Powerline Prompt with Git support

As you might have seen in the screenshots shown so far, I have also included a custom prompt with support for Powerline fonts. To be able to get the most out of this you will need to install a Powerline font, and then call Set-PowerlinePrompt to set the new custom prompt. Your old prompt is saved in the variable ‘originalPrompt’, and you can set this with ‘Set-Prompt $originalPrompt’. You need to install the PSGit module to get git support.

2016-09-26_19h39_35

Unfortunately, the support for extra colors is kind of buggy when used in the prompt, so until this is sorted out we have to use the old console colors here. I’ll update the module when this bug is fixed.

If you have any feedback let me know in the comments section below. If you create some nice color scheme for file colorization I’d love for you to share it!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s