PowerShell美化

PowerShell美化
Huazzi参考文章:windows terminal美化教程
主要步骤
1. 安装Windows Terminal
-
方式一:「微软商店」下载安装Windows Terminal
-
方式二:使用
winget安装1
winget install --id Microsoft.WindowsTerminal -e
2. 下载安装字体
-
下载后
双击安装 -
在Windows Terminal设置中使用字体
3. 安装oh-my-posh
- 方式一:「微软商店」安装
- 方式二:使用
winget安装:
1 | winget install JanDeDobbeleer.OhMyPosh -s winget |
顺带安装了
Get-ChildItemColor和posh-git
添加PATH路径:
1 | $env:Path += "C:\Users\user\AppData\Local\Programs\oh-my-posh\bin" |
4. 配置oh-my-posh
-
创建配置文件:
1
New-Item -Path $PROFILE -Type File -Force
-
编辑配置文件:
1
notepad $PROFILE
配置文件位置:
C:\Users\<userName>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
主要改动:
oh-my-posh不再需要模块导入,需要在配置文件中删去,否则一直弹出提示
配置文件内容:
1 | [System.Console]::OutputEncoding=[System.Text.Encoding]::GetEncoding(65001) # 配置默认编码 |
其中,
atomic.omp.json为所选的主题文件,可以在 「Themes | Oh My Posh 」这里找到自己喜欢的主题名称。
配置完成后关闭 terminal 重新开发就可以看到新的主题了。
- 保存文件,重启终端
篇结。
评论
匿名评论隐私政策
✅ 你无需删除空行,直接评论以获取最佳展示效果





![[Solution]Ubuntu虚拟机无法连接网络](https://cbc25ff.webp.li/001.jpg)






