188 字
1 分鐘
PowerShell Beautification Tutorial: oh-my-posh Theme Configuration Quick Start
Conclusion
- Use oh-my-posh + theme configuration to make PowerShell beautiful and user-friendly with a single command.
Where is this suitable?
- Engineers who want to enhance their CLI experience
- People who use PowerShell / Terminal for extended periods
- Those who want to quickly identify Git / path / status information
Steps
1. Install oh-my-posh
- Install the tool (skip if already installed)
- Verify command availability
oh-my-posh --version2. Query Themes
- View built-in theme list
Get-PoshThemes- Use this to pick your preferred style (recommended to test with default first)
3. Apply Theme
- Initialize PowerShell + specify theme
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression- The style will be applied immediately (for the current session)
4. Set Permanent Effect
- Open Profile
notepad $PROFILE- Add the following content
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-ExpressionAdditional Notes
- Requires Nerd Font (otherwise icons will be garbled)
- If Profile is not found → run
$PROFILEfirst to create it - Themes can be freely changed (directly modify the JSON file)
Command / Example Summary
Click to expand
# 查詢主題Get-PoshThemes
# 套用主題oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
# 編輯 Profilenotepad $PROFILEWrap-up
- With a single command, transform your CLI from a construction site to a boutique, and a pleasing interface truly encourages you to write more code.
PowerShell Beautification Tutorial: oh-my-posh Theme Configuration Quick Start
https://joyceowo.github.io/posts/en/23ba78ea09fa813393c1ea6288eb5afa/