参考:
本文为最新的 oh-my-posh 3 , 而不是 oh-my-posh2
参考:
DejaVuSansMono Nerd Font
https://www.nerdfonts.com/font-downloads

下载解压

选中所有 ttf 粘贴到 系统字体文件夹
C:\Windows\Fonts, 完成字体安装

在
Windows Terminalsettings.json中应用此字体
{
"profiles":
{
"defaults":
{
"font":
{
"face": "DejaVuSansMono Nerd Font"
}
}
}
}参考:
Install-Module oh-my-posh -Scope CurrentUser
# posh-git 将 git 信息添加到提示中
Install-Module posh-git -Scope CurrentUser
在 Windows Terminal 中输入以下两条命令
# 如果之前没有配置文件,就新建一个 Powershell 配置文件
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
# 打开配置文件,优先使用 vscode ,其次会使用记事本打开
code $PROFILE
#notepad $PROFILE
在配置文件中写入如下内容(脚本文件),并保存。 配置完后,每次打开 Windows Terminal 中的 Powershell 都会执行脚本文件中的三条命令。
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme Paradox
重启 Windows Terminal, 第一次打开后较慢, 需要下载相关, 以后就不会这么慢了

补充: 命令行自动补全和提示
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete补充: 可通过下方命令 查询所有 oh-my-posh 主题
Get-PoshThemes
补充: 本人最终选择主题:
unicorn

补充: PowerShell 标题修改 参考:
$host.UI.RawUI.WindowTitle = "eqweq"补充:
unicorn 主题配置文件
C:\Users\yiyun\.oh-my-posh\themes\unicorn.omp.json

感谢帮助!