188 字
1 分鐘
瀏覽次數
PowerShell Beautification Tutorial: oh-my-posh Theme Configuration Quick Start
2025-07-25
2026-04-10

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
Terminal window
oh-my-posh --version

2. Query Themes#

  • View built-in theme list
Terminal window
Get-PoshThemes
  • Use this to pick your preferred style (recommended to test with default first)

3. Apply Theme#

  • Initialize PowerShell + specify theme
Terminal window
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
Terminal window
notepad $PROFILE
  • Add the following content
Terminal window
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression

Additional Notes#

  • Requires Nerd Font (otherwise icons will be garbled)
  • If Profile is not found → run $PROFILE first to create it
  • Themes can be freely changed (directly modify the JSON file)

Command / Example Summary#

Click to expand
Terminal window
# 查詢主題
Get-PoshThemes
# 套用主題
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
# 編輯 Profile
notepad $PROFILE

Wrap-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/
作者
JoyceOwO
發佈於
2025-07-25
許可協議
CC BY-NC-SA 4.0