首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >试图安装哦-我的-时髦,但它告诉我,“这个词不被认为是.”

试图安装哦-我的-时髦,但它告诉我,“这个词不被认为是.”
EN

Stack Overflow用户
提问于 2021-12-13 12:56:50
回答 2查看 19.8K关注 0票数 10

所以我试着在windows上安装

Install-Module oh-my-posh -Scope CurrentUser

打字

Get-PoshThemes

查看我下载的可用主题。但我收到了这条信息

代码语言:javascript
复制
Get-PoshThemes : The term 'Get-PoshThemes' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Get-PoshThemes
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-PoshThemes:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有谁可以帮我?

EN

回答 2

Stack Overflow用户

发布于 2021-12-30 20:46:37

解决方案

(注:我运行的是PowerShell 7.1LTS)

首先,安装Nerd字体:

如果你已经跳过了

关于安装Nerd字体的说明:

https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#install-a-nerd-font

然后,安装oh-my-posh

安装:posh-git oh-my-posh**:**

代码语言:javascript
复制
   # This first step isn't included in the Microsoft Docs page:
   Install-Module posh-git -Scope CurrentUser
   
   # ...though this one is:
   Install-Module oh-my-posh -Scope CurrentUser

2. ...follow剩下的说明如下:

https://github.com/JanDeDobbeleer/oh-my-posh2#installation

3. ...finally,再次尝试命令:

代码语言:javascript
复制
   # Set the prompt theme (defaults to 'agnoster' for me)
   # ! Note: You have to do this step first (or it still won't work)
   Set-PoshPrompt

   # List the available themes (should work now)
   # ! Note: this will attempt to render a bunch of graphics in your shell
   Get-PoshThemes
   
   # ! Note: use the -List option to avoid a bunch of graphics in your shell
   # This will list the paths to the themes (in plaintext):
   Get-PoshThemes -List

可选

要避免手动输入Set-PoshPrompt,请在PowerShell $PROFILE中包含该命令

代码语言:javascript
复制
    # ...e.g. to use the included 'zash' theme:
    Set-PoshPrompt zash

当您打开start shell实例(即新的...you选项卡或窗口)时,PowerShell应该会看到您的PowerShell提示更改。

结束语(边注)

在我开始工作之前,我最初遵循了下面的说明:

https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#install-a-nerd-font

...no提到了posh-git模块或Set-PoshPrompt命令(截止到2021年12月30日)。

票数 11
EN

Stack Overflow用户

发布于 2022-04-13 20:22:09

我一直得到cmdlet,即使在遵循Robbie的指南之后也找不到错误。由于某些原因,新安装没有为我修复它,但更新程序修复了它:

代码语言:javascript
复制
Update-Module oh-my-posh
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70335044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档