安装

简介: 安装

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
目录
相关文章
|
开发工具 C语言 git
Vcpkg 的安装与使用
Windows 下 Vcpkg 的安装与使用
1357 0
Vcpkg 的安装与使用
|
6月前
|
程序员 Python
Anconda安装(超详细 3(4)
Anconda安装(超详细 3(4)
Anconda安装(超详细 3(4)
|
Docker 容器
buildx 安装
buildx 安装
660 0
安装
安装
115 0
KANZI-01-安装
第一次接触KANZI是在网上找模拟仪表相关的资料的时候发现的,那是看到时KANZI在Audio上面的应用,但是一直没有机会一览KANZI的真身,在网上是在找不到KANZI的安装包。
625 0
KANZI-01-安装
|
NoSQL MongoDB
Robomongo 的安装
Robomongo 的安装
136 0
Robomongo 的安装
|
Java 关系型数据库 MySQL
Linkis安装
Linkis安装
276 0
Linkis安装
|
算法 Ubuntu Linux
fsarchiver安装及使用
fsarchiver安装及使用
642 0
|
Ubuntu Linux
|
网络协议 数据安全/隐私保护 虚拟化