Configuring Oh My Posh and Nerd Fonts for Windows PowerShell

Core Installation

Install the prompt customization engine using the package manager or bootstrap script. Ensure your environment supports remote scripts by adjusting execution policies.

# Apply policy to allow script execution
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# Install via winget (Recommended)
winget install JanDeDobbeleer.OhMyPosh --source winget --accept-package-agreements --accept-source-agreements

Alternatively, run the official installer command in a fresh session to fetch the latest binaries directly from the repository.

Script Initialization

Configure the profile startup sequence to load themes and icon modules automatically on shell launch. Modify the system variable path defined by $PROFILE.

  1. Locate the current profile location:
$profile.CurrentUserCurrentHost
  1. If missing, generate the file srtucture:
New-Item $PROFILE -Force -ItemType File | Out-Null
  1. Append configuration logic to enable custom prompts and directory icons. Save the following block within the editor:
# Load theme engine with default configuration
$active_theme = 'jandedobbeleer'
oh-my-posh init pwsh --config "$active_theme" | Invoke-Expression

# Register file extension renderer
Import-Module Terminal-Icons
  1. Execute module installation if dependencies are not present:
Install-Module -Name Terminal-Icons -Scope CurrentUser -Force
  1. Reload the session settings:
.")profile.ps1

Glyph Rendering

Standard console fonts lack support for special symbols used by the theme and icon modules. Install a compatible Nerd Font variant to prevent rendering issues like empty squares.

Use the built-in utility to download supported typefaces:

oh-my-posh font install MesloLGS Nerd Font

Once installed, map this family name to your terminal emulator:

  • Windows Terminal: Navigate to Settings > Profiles > Defaults > Appearance > Set "Font face" to MesloLGS Nerd Font.
  • VS Code / Cursor: Search for Terminal › Integrated: Font Family in preferences and enter the specific font string.

Restarting the terminal tab is required for new font mappings to take effect.

Customization Options

Edit the initialization script to reference alternative theme definitions provided by the library. Supported styles include:

  • atomic: Minimalist visual layout.
  • powerlevel10k_rainbow: High contrast color spectrum.
  • star: Geometric design approach.
  • slimfat: Compact information density.

Switch themes by updating the config variable assignment inside the profile script.

Operational Maintenance

Common configuration hurdles can be resolved as follows:

  • Permission Denied Errors: Verify Execution Policy scope includes CurrentUser rather then Machine only.
  • Missing Icons: Confirm the font family configured in the GUI matches the installed Nerd Font exactly.
  • Module Conflicts: Disable the Terminal-Icons import line if graphical lists are unwented.

Apply changes immediately after editing by sourcing the profile or initiating a new process instance.

Tags: PowerShell oh-my-posh Nerd-Fonts Terminal-Configuration Windows

Posted on Mon, 19 Oct 2026 16:46:03 +0000 by JsusSalv