安装

简介: 安装

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
目录
相关文章
|
2月前
|
Shell 网络安全 开发工具
gitbash 安装与使用
gitbash 安装教程
38 1
|
7月前
|
程序员 Python
|
7月前
|
Kubernetes Linux Docker
k8s安装
kubeadm 方式安装K8S集群
308 0
|
Unix Linux Shell
Krew安装
Krew安装
242 0
安装
安装
116 0
安装
|
Python
Anconda安装(超详细 3.5X)
Anconda安装(超详细 3.5X)
157 0
Anconda安装(超详细 3.5X)
|
C++
VS2019 的安装
安装固性能速度会比较快;
988 0
VS2019 的安装
RedisClient 安装
RedisClient 安装
486 0
RedisClient 安装
|
存储 Java Linux
ELKStack快速安装
对于日志来说,最常见的需求就是收集、存储、查询、展示,开源社区正好有相对应的开源项目:logstash(收集)、elasticsearch(存储+搜索)、kibana(展示),我们将这三个组合起来的技术称之为ELKStack。
538 0
|
Python 开发工具 git