PowerShell script for managing Oh My Posh themes.
.\OhMyPoshManager.ps1 installInstalls Oh My Posh via winget. Installs CascadiaCode Nerd Font. Configures terminal font in Windows Terminal or VS Code settings.
Installs Oh My Posh and CascadiaCode Nerd Font. Skips if already installed.
Updates Oh My Posh to latest version via winget.
Removes Oh My Posh from system and PowerShell profile. Requires confirmation.
Sets specified theme. Updates both local OhMyPoshProfile.ps1 and $PROFILE. Restart terminal to apply. Use list to see available themes.
.\OhMyPoshManager.ps1 theme agnoster
.\OhMyPoshManager.ps1 theme paradoxDisplays all available Oh My Posh themes. Fetches from local installation or GitHub repository.
Displays current theme configuration. Shows profile path and local profile if present.
Removes Oh My Posh from profile. Reverts to PowerShell default prompt. Restart terminal to apply.
Previews theme rendering. Without argument, shows 10 random themes interactively. With theme name, shows single theme preview.
.\OhMyPoshManager.ps1 preview # Random themes
.\OhMyPoshManager.ps1 preview agnoster # Specific themeCopies current $PROFILE to backups/ directory. Auto-generates timestamp name if not provided.
.\OhMyPoshManager.ps1 backup
.\OhMyPoshManager.ps1 backup my-configRestores backup from backups/ directory to $PROFILE. Lists available backups if name not found.
Copies current $PROFILE to my-ohmyposh-config.ps1 in project directory.
Displays usage information.
Setting a theme:
- Creates/updates
OhMyPoshProfile.ps1in project directory - Updates
$PROFILEwith theme initialization - Requires terminal restart to apply
Theme sources:
- Fetches from
$env:POSH_THEMES_PATHif available - Falls back to
$env:LOCALAPPDATA\Programs\oh-my-posh\themes - Downloads from GitHub repository if local themes not found
Backups stored in backups/ directory with .ps1 extension.
Windows with winget. PowerShell 5.1 or later. Nerd Font for proper icon rendering.
- Install a Nerd Font:
.\OhMyPoshManager.ps1 install - Set the font in your terminal settings
Script execution error?
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser- Profile:
$PROFILE(usually~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1) - Themes:
$env:POSH_THEMES_PATH - Backups:
.\backups\
Created for easier shell customization