PowerShell Environment Customization
Implementation guide for enhancing the Windows terminal experience using PowerShell 7 and Oh My Posh.
1. Prerequisites
PowerShell 7+
Oh My Posh requires PowerShell 7+ (pwsh).
- Check Version:
- Installation:
Nerd Font (Iconography Support)
A Nerd Font is required for the correct rendering of icons and prompt separators.
- Font Installation:
- Terminal Configuration:
- Open Terminal Settings (
Ctrl+,). - Navigate to Profiles > Defaults > Appearance.
- Set Font face to
CaskaydiaCove Nerd Font.
2. Oh My Posh Installation
Installation is managed via winget:
Verification:
3. Profile Configuration
PowerShell 7 utilizes a distinct profile path from legacy versions.
- Verify Profile Path:
- Establish Profile File:
4. Theme Management
Theme configuration files must be downloaded and stored locally.
- Create Configuration Directory:
- Retrieve Configuration:
Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/emodipt-extend.omp.json" -OutFile "$HOME\.config\oh-my-posh\emodipt-extend.omp.json"
5. Activation
Initialize Oh My Posh within the PowerShell profile:
- Edit Profile:
- Append Initialization Command:
oh-my-posh init pwsh --config "$HOME\.config\oh-my-posh\emodipt-extend.omp.json" | Invoke-Expression
- Apply Changes: