
這種效果
1、安裝 Powerline 字體
安裝其中的 Cascadia Code PL 或 Cascadia Mono PL
2、PowerShell 必備條件
使用 PowerShell,安裝 Posh-Git 和 Oh-My-Posh
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
如果使用的是 PowerShell Core,請安裝 PSReadline
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
3、自定義 PowerShell 提示符(這里我已經(jīng)安裝了 Visual Studio Code 到 path)
code $PROFILE
在文件尾部添加如下
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt Paradox # Set-Theme 指令已經(jīng)被 Set-PoshPrompt 取代
現(xiàn)在,每個新實例啟動時都會導(dǎo)入 Posh-Git 和 Oh-My-Posh,然后從 Oh-My-Posh 設(shè)置 Paradox 主題
PS. 有可能因為策略原因打開失敗,可以嘗試
get-ExecutionPolicy # 查看系統(tǒng)執(zhí)行策略狀態(tài)
set-executionpolicy remotesigned # 修改執(zhí)行策略狀態(tài),改為一直允許
記得右鍵 Powerline 修改字體