PowerShell 7配置OhMyPosh主题
效果图这个是easy-term主题安装PowerShell 7下载地址: 官方GitHub下载后安装即可安装OhMyPosh官方文档winget install JanDeDobbeleer.OhMyPosh-s winget配置OhMyPosh下载主题主题下载地址把主题下载到一个指定位置, 记住这个位置, 后面要调用# 下载easy-term主题Invoke-WebRequest-Urihttps://wget.la/https://github.com/JanDeDobbeleer/oh-my-posh/raw/main/themes/easy-term.omp.json-OutFileD:\[个人文件夹]\PowerShell 7\Themes\easy-term.omp.jsonInvoke-WebRequest-Urihttps://wget.la/https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/cert.omp.json-OutFileD:\[个人文件夹]\PowerShell 7\Themes\cert.omp.jsonInvoke-WebRequest-Urihttps://wget.la/https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/craver.omp.json-OutFileD:\[个人文件夹]\PowerShell 7\Themes\craver.omp.jsonInvoke-WebRequest-Urihttps://wget.la/https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/blueish.omp.json-OutFileD:\[个人文件夹]\PowerShell 7\Themes\blueish.omp.jsonInvoke-WebRequest-Urihttps://wget.la/https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/atomic.omp.json-OutFileD:\[个人文件夹]\PowerShell 7\Themes\atomic.omp.json下载字体Nerd字体官网# 这里主要下载Meslo字体oh-my-posh font install meslo# 也可以github下载, 下载地址https://github.com/ryanoasis/nerd-fonts/releases, 下载后全选右键安装即可配置字体打开终端(PowerShell 7):CTRL SHIFT ,打开配置文件, 主要替换defaults字段{profiles:{defaults:{font:{face:MesloLGM Nerd Font}}}}配置主题# 打开终端配置文件notepad$PROFILE# 如果不存在, 创建配置文件New-Item-Path$PROFILE-TypeFile-Force# PS:查看默认终端oh-my-posh get shell在配置文件中加入oh-my-posh init pwsh--configD:\[个人文件夹]\PowerShell 7\Themes\easy-term.omp.json|Invoke-Expression引用的主题就是前面下载的主题重新打开一个PowerShell 7, 即可看到效果