Home Windows Windows 10 Deploy and Configure ‘Oh-My-Posh’

Deploy and Configure ‘Oh-My-Posh’

331
0
Reading Time: 3 minutes

In this blog post, I will cover the steps to improve your Powershell Console Styles! Oh-My-Posh is a Powershell module that turns your standard and boarding console into a console with style and colour! Oh-MyPosh module is supposed on 5.1, 6.x and 7.x as well as VSCode.

> Windows Terminal – Powershell 5.1 – Vanilla No Oh-My-Posh

> Windows Terminal – Powershell 5.1 – Pretty and Colourful (Oh-My-Posh)

Oh-My-Posh Pre-requisites

Firstly, to be able to enjoy the Oh-My-Posh module you will need to get yourself some Nerd Fonts, What are Nerd Fonts I hear you ask?

Oh My Posh was designed to use Nerd Fonts. Nerd Fonts are popular fonts that are patched to include icons. We recommend Meslo LGM NF, but any Nerd Font should be compatible with the standard themes.

To see the icons displayed in Oh My Posh, install a Nerd Font, and configure your terminal to use it.

https://www.nerdfonts.com/font-downloads

My current font, I’ve taken a liking for is the “JetBrainsMono Nerd font

When you have downloaded the font zip file and extracted you need to configure the font locations in three places depends on if your using Powershell (Default Console), Windows Terminal or Visual Studio Code.

For the module, I’ve just installed the JetBrains Mono Regular Nerd Font Complete Windows Compatible.ttf file.

The below shows what the default Windows Powershell Console looks like using a none Nerd Font File.

Configure Fonts for Default Powershell Console.

NOTE: I found that the JetBrainsMono NF Font would not show up under the default command window so had to opt for installing JetBrainsMonoMedium NF

Configure Fonts for Windows Terminal.

Configure Fonts for Visual Studio Code.

fid

The Automated Installation.

Earlier this week, I was chatting with @LuiseFreese and how Oh-My-Posh can improve your terminal session style, and that it’s a pretty straightforward install and configuration. Having jumped off the teams call, I realised that the issue we’d come across was that Powershell has 3 Profile files used depending on if you are running PowerShell 5.x Powershell 7.x or VSCode terminal. These file paths are located under.

Powershell 5.x
\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Powershell 7.x
\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

VSCode Terminal
\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1

GitHub Repository – HypervLAB

So I set about creating a script that checks to ensure that you have some form of Nerd Font installed and then set up the PowerShell Profiles for all three using Symbolic Links, depending on which edition you launch.

Finally some notable links:

https://ohmyposh.dev/

https://github.com/jandedobbeleer/oh-my-posh

https://twitter.com/jandedobbeleer

LEAVE A REPLY

Please enter your comment!
Please enter your name here