Working with the PowerShell in 2020 means fun, because of the new Windows Terminal (get it from Windows Store). It has more power as the old Powershell Console and it is visually adaptable to your personal taste, by installing the wonderful theming engine oh-my-posh from Jan De Dobbeleer.
To get Oh-My-Posh properly run, there are several steps to do I want to show here in a nutshell…
Step 1 - Install a suitable font
As the theming engine uses Powerline glyphs, you need to install a font which support them, for example the new Cascadia Code PL from Microsoft. Download, unzip and install the OTF and/or TTF font files via context menu in your Windows Explorer.
Step 2 - Set new font in your settings
Open up you Terminal settings…
… and add following new line to the PowerShell section:
1 | "fontFace": "Cascadia Code PL", |
Step 3 - Install oh-my-posh
Following PowerShell command installs the theming engine itself:
1 | Install-Module oh-my-posh -Scope CurrentUser |
If you want to display Git status information also, run this command:
1 | Install-Module posh-git -Scope CurrentUser |
To let the command-line editing environment to be customized install PSReadline:
1 | Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck |
Step 4 - Load on startup
In order to load the theming engine in every new terminal window, edit your PowerShell profile by opening it up with the command …
1 | notepad $PROFILE |
and add following lines in the upcoming text file:
1 | Import-Module oh-my-posh |
Paradox is one of 27 themes available. You will find all themes in your DOCUMENTS folder under ..\WindowsPowerShell\Modules\oh-my-posh\<version>\Themes
and some visual representations at https://github.com/JanDeDobbeleer/oh-my-posh?#themes.
More Info
- Windows Store: Windows Terminal
- Microsoft: Cascadia Code PL
- GitHub: JanDeDobbeleer/oh-my-posh
- Microsoft Docs: Set up Powerline in Windows Terminal
- Scott Hanselman: How to make a pretty prompt in Windows Terminal with Powerline, Nerd Fonts, Cascadia Code, WSL, and oh-my-posh
- Scott Hanselman: Taking your PowerShell prompt to the next level with Windows Terminal and Oh my Posh 3