- Microsoft store 下载安装PowerShell
安装模块
在线安装
install-module posh-gitinstall-module oh-my-posh
离线安装
- 模块下载地址:https://www.powershellgallery.com/packages
- 将模块 .nupkg 文件扩展名替换为 .zip 并解压
- 在Power Shell的模块安装目录(C:\Users\sunzhengbo\Documents\PowerShell\Modules)下安装模块的名称和版本号新建对应层级的目录,并将模块解压的文件拷贝至此,目录结构见下图
➜ Modules exa -T.├── oh-my-posh│ └── 6.4.3│ ├── bin│ │ ├── posh-darwin-amd64│ │ ├── posh-linux-amd64│ │ ├── posh-linux-arm│ │ ├── posh-linux-arm64│ │ ├── posh-windows-386.exe│ │ ├── posh-windows-amd64.exe│ │ └── posh-windows-arm64.exe│ ├── deploy.ps1│ ├── oh-my-posh.psd1│ ├── oh-my-posh.psm1│ ├── README.md│ └── themes│ ├── agnoster.omp.json│ ├── agnosterplus.omp.json│ ├── aliens.omp.json│ ├── amro.omp.json│ ├── avit.omp.json│ ├── blue-owl.omp.json│ ├── blueish.omp.json│ ├── bubbles.omp.json│ ├── bubblesline.omp.json... ...
编辑配置文件:notepad $profile
Import-Module posh-gitImport-Module oh-my-poshSet-PoshPrompt -Theme spaceship
