Oh My Posh Setup Guide — Windows 11 + Windows Terminal + PowerShell
A complete setup guide for Oh My Posh v26+ on Windows 11 — covering installation, Nerd Fonts, profile configuration, theme selection, and troubleshooting the common pitfalls older guides miss.
This guide covers the current version of Oh My Posh (v26+, MSIX-packaged
winget install) as of mid-2026. Many older tutorials reference
Get-PoshThemes and the POSH_THEMES_PATH environment variable — both
have been removed in modern versions. This guide uses the current,
name-based theme workflow.
What Is Oh My Posh?
Oh My Posh is a cross-shell prompt theme engine. It replaces your shell's
default prompt (the PS C:\Users\you> line) with a customizable,
information-rich prompt that can display your current directory, Git branch
and status, exit codes, language versions, execution time, and more.
Screenshot from ohmyposh.dev
Why it works everywhere: Oh My Posh is a single standalone binary written in Go. Your shell (PowerShell, Bash, Zsh, etc.) calls that binary every time it needs to draw a prompt, and the binary renders the prompt based on a JSON/YAML/TOML config file. This means one tool and one theme format work across every shell you use — including WSL2.
Prerequisites
- Windows 11 (Windows 10 also works)
- Windows Terminal (preinstalled on Windows 11; otherwise available from the Microsoft Store)
- PowerShell 7 (
pwsh) recommended — install withwinget install Microsoft.PowerShell winget(preinstalled on Windows 11)
Windows ships with the legacy Windows PowerShell 5.1
(powershell.exe). PowerShell 7 (pwsh.exe) is the modern,
actively developed version. Oh My Posh works with both, but they use
separate profile files — a common source of "I set it up but nothing
changed" confusion. See the Troubleshooting section.
Step 1 — Install Oh My Posh
Open a PowerShell tab in Windows Terminal and run:
winget install JanDeDobbeleer.OhMyPosh --source wingetThis installs the oh-my-posh executable and adds it to your PATH.
PATH changes only apply to new sessions. Close and reopen Windows
Terminal before continuing, or the oh-my-posh command won't be found.
Verify the install:
oh-my-posh versionThe winget package now uses MSIX packaging. Unlike older installers, it
does not ship a local themes folder and does not set the
POSH_THEMES_PATH environment variable. Themes are now referenced by
name and downloaded (and cached) automatically — covered in Step 5.
Step 2 — Install a Nerd Font
Oh My Posh themes use special glyphs — Git branch symbols, arrows, OS logos, powerline separators — that standard fonts don't contain. A Nerd Font is a regular font patched with thousands of these extra icons. Without one, your prompt will render as boxes and question marks.
Oh My Posh has a built-in font installer. Run it from an elevated (Administrator) terminal so the font installs system-wide:
oh-my-posh font installUse the arrow keys to pick a font. Recommended options:
| Font | Why |
|---|---|
| Meslo | Officially recommended by Oh My Posh — safest choice |
| CaskaydiaCove | Patched version of Cascadia Code (Windows Terminal's default), so it looks native |
| Hack, FiraCode, JetBrainsMono | Popular developer fonts, all fully patched |
Without admin rights, fonts install per-user only. That usually works, but some applications only see system-wide fonts — running elevated avoids the issue entirely.
Step 3 — Set the Font in Windows Terminal
Installing the font isn't enough — Windows Terminal must be told to use it.
- Open Windows Terminal settings: Ctrl+,
- In the left sidebar, select your PowerShell profile (or Defaults to apply it to all profiles, including WSL)
- Go to Appearance → Font face
- Select your Nerd Font, e.g.
MesloLGM Nerd Font - Click Save
Setting the font on Defaults rather than a specific profile means your WSL2 prompts also get the glyphs — Windows Terminal handles the rendering regardless of which shell is inside the tab.
Step 4 — Configure Your PowerShell Profile
Your PowerShell profile is a script that runs automatically at the start of every session. This is where Oh My Posh gets hooked in.
Open (or create) your profile
notepad $PROFILEIf Notepad reports the file doesn't exist, create it first:
New-Item -Path $PROFILE -Type File -Force
notepad $PROFILE$PROFILE is an automatic variable holding the path to your profile
script for the current PowerShell version and host. For PowerShell 7
this is typically:
C:\Users\<username>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Add the init line
Add this line to the file and save:
oh-my-posh init pwsh | Invoke-Expressionoh-my-posh init pwsh prints a shell-integration script tailored to
PowerShell. Invoke-Expression executes it — replacing PowerShell's
built-in prompt function with one that calls Oh My Posh on every draw.
Reload
Open a new tab, or reload the profile in place:
. $PROFILEYou should now see the default Oh My Posh theme.
If you see "Running scripts is disabled on this system", your execution policy is blocking the profile script. Fix it with:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserRemoteSigned lets local scripts run freely while requiring signatures
for scripts downloaded from the internet. The -Scope CurrentUser flag
means no machine-wide policy changes.
Step 5 — Choose and Set a Theme
Browse themes
Preview every theme with screenshots at the official gallery: ohmyposh.dev/docs/themes
Older guides tell you to run Get-PoshThemes or browse
$env:POSH_THEMES_PATH. Both were removed in modern versions. The
gallery and name-based references below are the current workflow.
Try themes live
Swap the theme in your current session by re-running init with a theme name — no profile edits needed:
oh-my-posh init pwsh --config atomic | Invoke-Expression
oh-my-posh init pwsh --config catppuccin_mocha | Invoke-Expression
oh-my-posh init pwsh --config jandedobbeleer | Invoke-ExpressionWhen given a bare theme name, Oh My Posh downloads the config from the official repository and caches it locally so subsequent shell startups don't re-download it. Your prompt changes instantly against your real directory and Git state.
Make it permanent
Once you've picked a theme, update the init line in $PROFILE:
oh-my-posh init pwsh --config atomic | Invoke-ExpressionSave, then open a new tab or run . $PROFILE.
Use a local copy (recommended)
Name-based themes require an internet connection on first use and re-fetch when the cache expires. For a fully offline, version-controlled setup, export the theme locally once:
oh-my-posh config export --config atomic --output "$HOME\.config\my_theme.omp.json"Then point your profile at the file — always use the full absolute path:
oh-my-posh init pwsh --config "$HOME\.config\my_theme.omp.json" | Invoke-ExpressionA local copy means your prompt no longer depends on network access or upstream theme changes. The local JSON is also your starting point for customization — edit segments, colors, and icons directly and keep it in Git alongside your other dotfiles.
Optional Extras
Terminal-Icons — file and folder icons in ls output
Install-Module -Name Terminal-Icons -Repository PSGalleryAdd to $PROFILE:
Import-Module -Name Terminal-IconsOh My Posh in WSL2
The same engine works inside your Linux distros. Install via the Linux
install script or Homebrew, then add to ~/.bashrc or ~/.zshrc:
eval "$(oh-my-posh init bash --config atomic)"Since Windows Terminal renders WSL tabs, the Nerd Font from Step 3 already
covers them. You can even share a single theme file — your Windows home
directory is reachable from WSL at /mnt/c/Users/<username>/.
Keeping Oh My Posh updated
winget upgrade JanDeDobbeleer.OhMyPosh --source wingetTroubleshooting
Icons show as boxes or question marks
The terminal isn't using a Nerd Font. Confirm Step 3 — the Font face for your active profile must be the Nerd Font. If you use VS Code's integrated terminal, set the font there too:
"terminal.integrated.fontFamily": "MesloLGM Nerd Font"Get-PoshThemes is not recognized
Expected on modern versions — the function was removed around v25.6. Browse themes at ohmyposh.dev/docs/themes and reference them by name. If an old guide told you to use it, the rest of that guide is likely outdated.
$env:POSH_THEMES_PATH is empty
Also expected — the MSIX-packaged winget install doesn't ship local themes
or set that variable. Use name-based references or oh-my-posh config export.
Running Get-ChildItem $env:POSH_THEMES_PATH with the variable unset
silently lists your current directory instead of erroring — the
empty variable expands to nothing, so Get-ChildItem falls back to its
default location. If a themes "listing" shows your home folder contents,
this is why.
oh-my-posh is not recognized
Close and reopen the terminal — PATH updates don't apply to already-open sessions. If still failing, verify the install:
winget list JanDeDobbeleer.OhMyPoshIf you ever installed the old PowerShell module version, uninstall it — it's deprecated and conflicts with the binary:
Uninstall-Module oh-my-posh -AllVersionsRemove any Import-Module oh-my-posh or Set-PoshPrompt lines from
$PROFILE as well.
Profile edits do nothing
Two common causes:
Wrong profile file — PowerShell 7 and Windows PowerShell 5.1 use
different profiles. Run $PROFILE inside the exact tab you're using and
confirm that's the file you edited.
OneDrive redirection — if your Documents folder is synced by OneDrive,
the profile path includes OneDrive\Documents\.... Trust the output of
$PROFILE, not what you expect the path to be.
CONFIG ERROR appears in the prompt
Oh My Posh can't load the config file. Verify the path exists and is a
full absolute path — prefer $HOME over ~ on Windows. If your profile
still references $env:POSH_THEMES_PATH\theme.omp.json, that path no
longer exists. Switch to a theme name or an exported local file.
CONFIG ERROR but Test-Path returns True
The file exists but can't be parsed. Three common causes:
- Wrong content — saved a GitHub page (HTML) instead of the Raw file.
Check:
Get-Content <path> -TotalCount 5— it should start with{and a"$schema"line - Truncated JSON — partial copy-paste. Validate with:
Get-Content <path> -Raw | ConvertFrom-Json | Out-NullSilence = valid; an error = malformed JSON
- Wrong encoding — files created via
>in Windows PowerShell 5.1 are UTF-16. Check:Get-Content <path> -AsByteStream -TotalCount 3—255 254= UTF-16 (broken),123= UTF-8 (fine)
Skip the diagnosis entirely — overwrite the broken file with an official export, which fixes all three causes at once:
oh-my-posh config export --config <theme_name> --output <path>
. $PROFILEPrompt renders incorrectly after upgrading to PowerShell 7.4+
PowerShell 7.4 has a known encoding issue affecting prompt rendering. Add
this above the Oh My Posh init line in $PROFILE:
[console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new()Treat this as a temporary workaround — forcing UTF-8 session-wide can affect other executables.
Prompt feels slow
oh-my-posh debugThis shows per-segment timings and identifies the culprit. Antivirus real-time scanning commonly delays the binary on every prompt draw. Add a Windows Defender exclusion for the executable:
(Get-Command oh-my-posh).SourceIf only Git repos are slow, run git gc inside the repo to optimize it.
Glyphs broke after a Nerd Fonts v3 update
Nerd Fonts v3 relocated many icons. Oh My Posh ships a built-in migration:
oh-my-posh config migrate glyphs --config "path\to\your\theme.omp.json"A .bak backup of your config is created alongside it.
Quick Reference
| Task | Command |
|---|---|
| Install | winget install JanDeDobbeleer.OhMyPosh --source winget |
| Update | winget upgrade JanDeDobbeleer.OhMyPosh --source winget |
| Install a Nerd Font | oh-my-posh font install (elevated) |
| Edit profile | notepad $PROFILE |
| Reload profile | . $PROFILE |
| Try a theme (current session) | oh-my-posh init pwsh --config <name> | Invoke-Expression |
| Export theme locally | oh-my-posh config export --config <name> --output <path> |
| Debug slow prompt | oh-my-posh debug |
| Check version | oh-my-posh version |
Theme gallery: ohmyposh.dev/docs/themes Official docs: ohmyposh.dev/docs