尝试导入oh-my-posh' Windows终端中的导入模块

发布于 2025-02-13 04:03:03 字数 1066 浏览 1 评论 0原文

我安装了oh我的posh模块,并试图用import-odule-oh-my-posh导入它。但是我会收到以下错误,

Downloading oh-my-posh executable for 7.36.1
Get-CimInstance : Invalid class
At C:\Program Files\WindowsPowerShell\Modules\oh-my-posh\7.36.1\oh-my-posh.psm1:66 char:18
+ ...    $arch = (Get-CimInstance -Class Win32_Processor -Property Architec ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [Get-CimInstance], CimException
    + FullyQualifiedErrorId : HRESULT 0x80041010,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

Import-Module : oh-my-posh: Unsupported architecture:
At line:1 char:1
+ Import-Module oh-my-posh
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (oh-my-posh: Unsupported architecture: :String) [Import-Module], Runti
   meException
    + FullyQualifiedErrorId : oh-my-posh: Unsupported architecture: ,Microsoft.PowerShell.Commands.ImportModuleCommand

为什么我会得到这个?我在set-executionpolicy无限制之前运行

I installed the oh my posh module and am trying to import it with Import-Module oh-my-posh. But I'm getting the following error

Downloading oh-my-posh executable for 7.36.1
Get-CimInstance : Invalid class
At C:\Program Files\WindowsPowerShell\Modules\oh-my-posh\7.36.1\oh-my-posh.psm1:66 char:18
+ ...    $arch = (Get-CimInstance -Class Win32_Processor -Property Architec ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [Get-CimInstance], CimException
    + FullyQualifiedErrorId : HRESULT 0x80041010,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

Import-Module : oh-my-posh: Unsupported architecture:
At line:1 char:1
+ Import-Module oh-my-posh
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (oh-my-posh: Unsupported architecture: :String) [Import-Module], Runti
   meException
    + FullyQualifiedErrorId : oh-my-posh: Unsupported architecture: ,Microsoft.PowerShell.Commands.ImportModuleCommand

Why am I getting this? I ran Set-ExecutionPolicy Unrestricted before

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

话少心凉 2025-02-20 04:03:03

该模块不再支持,因此由于此问题而解决了此问题。看看在这里让您再次前进。

The module is no longer supported, and this issue has been resolved in the meantime because of it. Have a look here to get you going again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文