安装

简介: 安装

Chocolatey

提示

Chocolatey 不是 Windows 系统自带的,是自己安装的,请参考笔记:Chocolatey

$ choco install oh-my-posh
$ refreshenv    # 刷新环境变量点击复制复制失败已复制


注意

以管理员身份运行终端进行安装


安装日志

$ choco install oh-my-posh
Chocolatey v0.10.15
Installing the following packages:
oh-my-posh
By installing you accept licenses for the packages.
oh-my-posh v3.180.3 [Approved]
oh-my-posh package files install completed. Performing other installation steps.
The package oh-my-posh wants to run 'chocolateyinstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y
Downloading oh-my-posh 64 bit
  from 'https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v3.180.3/install.exe'
Progress: 100% - Completed download of C:\Users\Iric\AppData\Local\Temp\chocolatey\oh-my-posh\3.180.3\install.exe (21.54 MB).
Download of install.exe (21.54 MB) completed.
Hashes match.
Installing oh-my-posh...
oh-my-posh has been installed.
PROFILE: C:\Users\Iric\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
No Powershell profile was found. You may wish to create a profile and append 'Invoke-Expression (oh-my-posh --init --shell pwsh --config > "C:\Users\Iric\AppData\Local/Programs/oh-my-posh/themes/themename.omp.json")' to enable oh-my-posh. 'Get-PoshThemes' will list available themes for you
  oh-my-posh can be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of oh-my-posh was successful.
  Software installed to 'C:\Users\Iric\AppData\Local\Programs\oh-my-posh\'
Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).点击复制复制失败已复制


重启!

PowerShell(推荐)

$ Install-Module oh-my-posh -Scope CurrentUser
$ Install-Module posh-git -Scope CurrentUser    # 官方没有指出,但是一般都要安装git集成点击复制复制失败已复制


查看可用主题

$ Get-PoshThemes
or
$ Get-PoshThemes -list点击复制复制失败已复制


更新

$ Update-Module oh-my-posh点击复制复制失败已复制


主题配置

输入如下两行命令,编辑PROFILE文件

$ if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
$ notepad $PROFILE点击复制复制失败已复制


在弹出的记事本中输入如下内容:

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme agnoster点击复制复制失败已复制


保存,并执行如下命令是配置生效:

$ . $PROFILE
目录
相关文章
|
Kubernetes Linux 网络安全
安装k8s
完成安装k8s集群以后,推荐使用[https://github.com/512team/dhorse](https://github.com/512team/dhorse)发布应用。 ## 准备环境 准备两台服务器节点,如果需要安装虚拟机,可以参考[《wmware和centos安装过程》](https://blog.csdn.net/huashetianzu/article/details/109510266) | 机器名 | IP | 角色 | CPU | 内存 | | :----: | :----: | :----: | :----: | :----: | | centos01 |
|
SQL 前端开发 JavaScript
Notepad++介绍与安装
Notepad++介绍与安装
578 0
(4)(4.2.1) 安装自动驾驶仪
(4)(4.2.1) 安装自动驾驶仪
81 0
|
Unix Linux Shell
Krew安装
Krew安装
231 0
|
定位技术
g2o安装
g2o安装
307 0
g2o安装
|
NoSQL MongoDB
Robomongo 的安装
Robomongo 的安装
139 0
Robomongo 的安装
|
算法 Ubuntu Linux
fsarchiver安装及使用
fsarchiver安装及使用
644 0
5分钟快速安装Syncthing
简介 Syncthing是一个开源免费的文件夹/文件同步神器,支持Android、Linux、Windows、Mac OS X等系统,可以使我们在2台任何系统任何设备之间,实现文件实时同步,很强大。而且数据很安全,不会存储在你的设备以外的其他地方。
5049 0
|
应用服务中间件 PHP nginx