安装 oh-my-posh
安装 nerd font 字体
https://www.nerdfonts.com/font-downloads
随便安装一个即可,如果不安装的话,后期 oh-my-posh 显示的字体可能会有乱码。
使用 scoop 安装
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"
scoop update oh-my-posh
notepad $PROFILE
oh-my-posh init pwsh | Invoke-Expression
切换主题
所有的主题:https://ohmyposh.dev/docs/themes
将上面的第五步中的主题切换接口:
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\avit.omp.json | Invoke-Expression