terminal: Windows Terminal - PowerShell customization via oh-my-posh/posh-git Set-Theme error?

Windows Terminal - PowerShell customization via oh-my-posh/posh-git Set-Theme error?

I follow the exact tutorial of Microsoft link: Link Here video link: Video Link Here

I have installed Posh-Git and Oh-My-Posh: via this code - Install-Module posh-git -Scope CurrentUser Install-Module oh-my-posh -Scope CurrentUser

I have installed PSReadLine: via this code - Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

I am also created Microsoft.PowerShell_profile.ps1 file by typing- code $PROFILE, in my PowerShell profile and copy/paste this code: Import-Module posh-git Import-Module oh-my-posh Set-Theme Paradox

But I get this error:

Set-Theme Paradox The term ‘Set-Theme’ is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

ScreenShot: Screenshot of error

ssss

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 21
  • Comments: 29 (4 by maintainers)

Commits related to this issue

Most upvoted comments

It seems the “Set-Theme” cmdlet was renamed to “Set-PoshPrompt”.

It seems the “Set-Theme” cmdlet was renamed to “Set-PoshPrompt”. thank you,i have solved it

I was having the same issue as the users above me. I followed the tutorial as well. I believe this error occurs because a command given by the documentation installs an older version, see: Install-Module oh-my-posh -Scope CurrentUser -RequiredVersion 2.0.412 This conflicts with the given PowerShell configuration, as it is intended for newer versions of oh-my-posh. The version installed by the tutorial command works if you switch from Set-PoshPrompt back to Set-Theme, although I would suggest following the advice given above - although a small correction is required, since the command is Update-Module instead of Update_Module.

Hey I’m getting this error, does anyone have a fix?

I followed the tutorial in the Terminal docs here

image

Hey, I had the same issue. I did Update_Module in Powershell, it will update the oh-my-posh module to lastest version (actually all modules, you can also update oh-my-posh only). Then i got no errors. Hope this works for you too.

I have tried everything of the above but nothing worked. oh-my-posh was the only command that my powershell would find.

What worked for me is using the following command that is in this guide (I had to use the whole path to where the themes are):

oh-my-posh --init --shell pwsh --config ~\AppData\Local\Programs\oh-my-posh\themes\bubblesline.omp.json | Invoke-Expression

Saved this in the Microsoft.Powershell_profile.ps1 file and it works now.

I was also missing some characters so i downloaded the cascadia-code-nerd-font (I used chocolatey for it).

choco install cascadia-code-nerd-font

And then selected it in the windows terminal go to Settings -> Profiles -> PowerShell -> Appearance -> Font face on the windows terminal

I hope this methods helps someone!

Hey I’m getting this error, does anyone have a fix?

I followed the tutorial in the Terminal docs here

image

I installed the latest version of oh-my-posh i.e. if you follow the guide on microsoft don’t use the required version but let it install the latest.

For anyone still struggliong with this issue use Set-PoshPrompt, as JustDre said above, followed by the -Theme option. Here is an example: Set-PoshPrompt -Theme pixelrobots I am using posh-git version 1.0.0 and oh-my-posh version 3.157.2. Hope this helps

Hi! Any updates about it? I’ve been received the same message error!

image

I updated my ExecutionPolicy to Unrestricted and then installed the Modules Again, and finally worked! Set-ExecutionPolicy unrestricted Install-Module oh-my-posh -Scope CurrentUser Install-Module posh-git -Scope CurrentUser Set-PoshPrompt -Theme Paradox

Just use

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

on Microsoft.PowerShell_profile.ps1 file and enjoy.

It seems the “Set-Theme” cmdlet was renamed to “Set-PoshPrompt”.

Yeah it did work fine. Change “Set-Theme” to “Set-PoshPrompt”