首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Powershell 5.1中安装“我的时尚”的主题?

如何在Powershell 5.1中安装“我的时尚”的主题?
EN

Stack Overflow用户
提问于 2021-12-11 13:52:51
回答 1查看 1.3K关注 0票数 0

我每天在Windows终端上使用Powershell 5.1。然而,几天后,我的“噢,我的时髦”主题停止了工作,并打印了一个错误,说它找不到我想要的主题(iterm2),并返回到默认主题。

我已经删除了(Remove-Module -Name oh-my-posh -Force)和重新安装(Install-Module -Name oh-my-posh -Scope CurrentUser)哦,我的时髦,但这还没有解决问题。怎么解决?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-11 14:02:15

这也发生在我身上。我通过在正确的地方手动下载主题来修复它。

如果您想让它变得简单,我创建了一个powershell一行程序来修复它:

代码语言:javascript
复制
New-Item -Path "$home\Documents\WindowsPowerShell\Modules\oh-my-posh" -Name "themes" -ItemType Directory; Set-Location -Path "$home\Documents\WindowsPowerShell\Modules\oh-my-posh\themes"; Invoke-WebRequest -UseBasicParsing -Uri https://api.github.com/repos/JanDeDobbeleer/oh-my-posh/contents/themes | Select-Object -ExpandProperty Content | ConvertFrom-Json | ForEach-Object {$_ | Select-Object -ExpandProperty name | Select-String -Pattern ".*.omp.json"} | ForEach-Object {$_.toString().Replace(".omp.json", "")} | ForEach-Object {Invoke-WebRequest -Uri "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/$_.omp.json" -UseBasicParsing -OutFile "$_.omp.json"}

它使用GH获取当前可用主题的列表,然后用一点PowerShell魔力将它们下载到正确的位置。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70315732

复制
相关文章

相似问题

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