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.
- Locate the current profile location:
$profile.CurrentUserCurrentHost
- If missing, generate the file srtucture:
New-Item $PROFILE -Force -ItemType File | Out-Null
- 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
- Execute module installation if dependencies are not present:
Install-Module -Name Terminal-Icons -Scope CurrentUser -Force
- 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 Familyin 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
CurrentUserrather thenMachineonly. - Missing Icons: Confirm the font family configured in the GUI matches the installed Nerd Font exactly.
- Module Conflicts: Disable the
Terminal-Iconsimport line if graphical lists are unwented.
Apply changes immediately after editing by sourcing the profile or initiating a new process instance.