我每天在Windows终端上使用Powershell 5.1。然而,几天后,我的“噢,我的时髦”主题停止了工作,并打印了一个错误,说它找不到我想要的主题(iterm2),并返回到默认主题。
我已经删除了(Remove-Module -Name oh-my-posh -Force)和重新安装(Install-Module -Name oh-my-posh -Scope CurrentUser)哦,我的时髦,但这还没有解决问题。怎么解决?
谢谢
发布于 2021-12-11 14:02:15
这也发生在我身上。我通过在正确的地方手动下载主题来修复它。
如果您想让它变得简单,我创建了一个powershell一行程序来修复它:
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魔力将它们下载到正确的位置。
https://stackoverflow.com/questions/70315732
复制相似问题