对 *nix 平台上的 oh-my-zsh 的绝赞复刻!

备受好评的 shell 配置,来到了 powershell 之上~

requirements

  • set-executionpolicy remotesigned 执行策略更改,以执行脚本、安装应用
  • scoop

installation

1
2
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
1
scoop install scoop-completion

亦可均由 scoop 安装,即

1
2
3
scoop install scoop-completion
scoop install oh-my-posh
scoop install posh-git

配置

配置文件为 ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1,若不存在请自行创建。

写入下列内容并保存:

1
2
3
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme PowerLine

more things

  • 我的 profile 文件与自己写的主题 dotfiles/powershell
  • 最好用 Windows Terminal 作为终端