- 安装模块
Install-Module oh-my-posh
- 获取皮肤
Get-PoshThemes
- 更新模块
Update-Module oh-my-posh
- 卸载模块
Uninstall-Module oh-my-posh -Force
- 修改脚本策略
Set-ExecutionPolicy RemoteSigned
- 创建配置文件
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
- 写入脚本保存
notepad $profile
- 这两种字体均在github上开源,楼主使用的是DejaVuSansMono Nerd Font或Cousine Nerd Font,这两套字体支持的图标比较全。
- nerd字体
powerline字体
- Q:有些特殊符号为什么显示不出来?
- A:因为oh-my-posh主题中包含着各种角标和字体,需要nerd字体或者powerline字体支持。下载字体压缩包-解压-选中字体-为所有用户安装-设置控制台属性-默认-字体-Meslo Nerd Font。
- Q:怎么样才能永久设置皮肤?
- A:主题最终呈现的效果,均在$profile文件中。用记事本打开,写入设置皮肤命令
Set-PoshPrompt -Theme nu4a
,保存。可参考楼主配置文件$profile