DEV Community

loading...

Making powershell pretty

Jonathan Creamer
Originally published at jonathancreamer.com on ・2 min read

For the first time in a long time, Windows has re-entered my life now that I work at Microsoft.

In macOS land, I use iTerm and oh-my-zsh to make a pretty shell environment with all the colors and such, so when I got to Windows again and lanched into the blue Powershell Window, I figured there had to be something better...

This is what Powershell looks like now!

Windows Terminal

The first thing to make sure you have installed is the Windows Terminal.

That is a fantastic product, and even has built in support for WSL, CMD, Azure, and launching into Ubuntu or whatever your Linux Environment is...

Another #protip is you can hold Ctrl + Shift when launching Windows Terminal and it'll open as an Administrator.

Windows Terminal is super easy to configure as well, and there are themes for it as well at >_TerminalSplash - Windows Terminal Themes or Windows Terminal Themes. You simply copy the JSON from those sites, and open the Windows Terminal Settings and Click "Open JSON File"...

Oh My Posh

The tool that adds the bar at the bottom of the Powershell window is called Oh My Posh of course inspired by oh-my-zsh for mac / linux.

To install, simply run...

Install-Module oh-my-posh -Scope CurrentUser
Enter fullscreen mode Exit fullscreen mode

Then you can list all the themes with...

Get-PoshThemes
Enter fullscreen mode Exit fullscreen mode

Once you find one you like, you can edit your $PROFILE in your editor of choice, e.g. notepad $PROFILE, code -a $PROFILE.

And you can set your theme up with...

Set-PoshPrompt -Theme jandedobbeleer
Enter fullscreen mode Exit fullscreen mode

The last thing you'll more than likely also have to do is download the right fonts that supports "Powerline" fonts, the Oh My Posh docstalk about that. More than likely, you'll choose a font from Nerd Fonts, and update your Windows Terminal settings to point to the new font.

"profiles": 
    {
        "defaults": 
        {
            "fontFace": "MesloLGL Nerd Font"
        }
     }
Enter fullscreen mode Exit fullscreen mode

It'll even show you what version of node you're in as well as many other what they call "Segments"...

There ya go! You'll be the envy of all your Windows code demos in meetings going forward.

Discussion (0)