安装

简介: 安装

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
目录
相关文章
|
网络安全 数据安全/隐私保护
Cloudify-安装(4.5.0)
Cloudify安装文档
343 0
Cloudify-安装(4.5.0)
|
10月前
|
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 |
|
NoSQL 网络安全 Redis
redisd的简易安装运用
redisd的简易安装运用
64 0
安装
安装
99 0
安装
WinDriver 安装
WinDriver 安装
115 0
|
Kubernetes 数据可视化 Docker
dacker安装
dacker安装
|
Python
Kazoo安装和使用
Kazoo安装和使用
405 0
|
网络协议 MySQL 关系型数据库