Presently sponsored by: ScriptRunner - Get your free PowerShell Security e-Book!

This is another post in the series about fun and helpful Windows Terminal tips and tricks. Here's a list of the posts in this series.

What is oh-my-posh?

Oh my Posh is a custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable.
- https://ohmyposh.dev/docs/

Here's what my Windows Terminal looks like when I have Oh-my-posh installed, along with the posh-git tools that provides the added git-specific metadata in the command prompt. The theme I selected for this is Alien.

Alien theme for the Oh-my-posh PowerShell experience in Windows Terminal.

Before the configuration, it makes sense to select a theme.

Installing oh-my-posh

Following the instructions, here's the things we need to do.

Install the oh-my-posh module.

Install-Module oh-my-posh -Scope CurrentUser -AllowPrerelease

Download all the existing themes to your machine.

Get-PoshThemes

Modify the PowerShell profile

Finally, if you want to standardize your PowerShell shell to always use oh-my-posh, you need to modify your $PROFILE.

The docs mentions you can use Notepad, but I prefer to use Visual Studio Code. The choice is yours. Here's how I'm modifying the file and adding the required module and theme config so they are applied when launching my PowerShell sessions next time.

Open the PowerShell $PROFILE configuration file.

Add the necessary configurations. Make a note of the Theme name here, which is one of the names of all the downloaded themes.

Import-Module oh-my-posh
Set-PoshPrompt -Theme Aliens

Install fonts with support for the glyphs

Moving on, the final missing piece on a normal machine, is to get the Powerlines fonts working. In the docs of oh-my-posh, it's recommended to use NerdFonts.

I like Caskaydia Cove Nerd Font, which has the font name CaskaydiaCove NF name when configuring it in the Windows Terminal font settings.

Make a choice, install the fonts you want to work with, and reboot your terminal.

In the picture here, I settled for one of the themes that are more easy on the eyes, Agnoster.

Agnoster theme for Windows Terminal and Oh-my-posh.

I'm happy with the configuration, and I really like to get the visual indicators in the terminal about my git status, and the overall terminal look and feel resonates well with me.

Enjoy.