powershell美化
效果图

安装oh-my-posh
在Microsoft Store安装Windows Terminal
执行如下命令
1 | Set-ExecutionPolicy Bypass |
如有提示按y即可
启用oh-my-posh
配置PowerShell启动脚本
1 | notepad $PROFILE |
导入相应模块
1 | Import-Module oh-my-posh |
设置主题为agnosterplus
1 | Set-PoshPrompt -Theme agnosterplus |
解决字体乱码
下载Nerd Fonts,这里我选择的是Meslo Fonts
解压,选择Meslo LG S Regular Nerd Font Complete Windows Compatible.ttf
并安装
打开Windows Terminal,按Ctrl + ,
打开设置,点击Windows Powershell
–> 外观
,将字体改为刚才安装的MesloLGS NF
,如图所示

启用模糊背景
设置
–> Windows Powershell
–> 外观
–> 透明度
启用 Enable acrylic
项

允许PowerShell执行任意脚本
1 | Set-ExecutionPolicy Unrestricted |