小编Ogg*_*ggy的帖子

术语“oh-my-posh”未被识别为 cmdlet 的名称

我已将 oh-my-posh 配置为在 powershell 上工作,如果我从 Windows 终端运行 powershell,一切都会按预期工作(文档中清楚地说明了这一点)

\n

不过,我倾向于从 WSL 终端运行 powershell,因为我有这样的别名\n psl='/mnt/c/Program\\ Files/PowerShell/7/pwsh.exe'

\n

但现在当我运行该别名时出现以下错误

\n
oh-my-posh: C:\\Users\\username\\OneDrive\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1:19\nLine |\n  19 |  oh-my-posh init pwsh --config 'C:\\Users\\username\\OneDrive\\Documents\\Powe \xe2\x80\xa6\n     |  ~~~~~~~~~~\n     | The term 'oh-my-posh' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the\n     | name, or if a path was included, verify that the path is correct and try again\n
Run Code Online (Sandbox Code Playgroud)\n

有什么想法吗?\n谢谢

\n

我尝试更改路径,但终端似乎无法识别 oh-my-posh

\n

powershell wsl-2 oh-my-posh

5
推荐指数
1
解决办法
2956
查看次数

标签 统计

oh-my-posh ×1

powershell ×1

wsl-2 ×1