DEV Community

Cover image for Oh my posh for Windows (2021 guide)
Debarghya Datta
Debarghya Datta

Posted on • Updated on

Oh my posh for Windows (2021 guide)

Step 1: Install powershell from microsoft store. Click here.

Step 2: Download and install Nerd font. Click here

Step 3: Choose the nerd font you installed.

Nerd font

Step 4: Open Powershell as administrator and paste the following lines and choose yes to all.

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name Terminal-Icons -Repository PSGallery

Step 5: Go to my Documents and look for a file named Microsoft.PowerShell_profile.ps1. If it doesn't exist create one.

Step 6: Paste the following lines in the file.

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\night-owl.omp.json"| Invoke-Expression
Import-Module -Name Terminal-Icons
oh-my-posh init pwsh --config "THEME PATH" | Invoke-Expression

Step 7: Paste the following line in terminal window.

Get-PoshThemes.

Ignore any errors.

Close and reopen terminal. You're all set!!

Top comments (5)

Collapse
 
jandedobbeleer profile image
Jan De Dobbeleer

The guide is incorrect as Install-Module oh-my-posh -Scope CurrentUser is no longer supported. Please update this to reflect the process here.

Collapse
 
geekheaddd profile image
Debarghya Datta

Works fine on my pc.
proof

Collapse
 
jandedobbeleer profile image
Jan De Dobbeleer

Sure. But you’ll have outdated software (7 months have passed since the last push to the gallery). See here for context.

Thread Thread
 
geekheaddd profile image
Debarghya Datta

My bad, will update the post. Thank you so much for pointing this out :)

Collapse
 
geekheaddd profile image
Debarghya Datta