The term ‘Set-Theme‘ is not recognized as the name of a cmdlet,

解决方案

在powershell中输入$profile,找到文件后,我的结果如下(如果没有就在相同位置创建一个文件,名字一样):
在这里插入图片描述
在文件内容更改,注释Set-Theme,在后面加入另一句话,示例如下:

# Set-Theme Paradox
Set-PoshPrompt -Theme M365Princess
oh-my-posh --init --shell pwsh --config ~/AppData/Local/Programs/oh-my-posh/themes/M365Princess.omp.json | Invoke-Expression

文件截图如下:
在这里插入图片描述

注:M365Princess是个人的字体,具体名字见Oh My Posh官网


版权声明:本文为fancy_male原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。