Windows-Env
Oh My Posh

oh-my-posh Setup

Docs (opens in a new tab)

Installation

  • Installation command
winget install JanDeDobbeleer.OhMyPosh -s winget
  • Reload path or restart terminal
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"
  • Install a font if needed
oh-my-posh font install
  • Open windows terminal settings CTRL + SHIFT + ,
{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "FONT_NAME_SELECTED_LAST_COMMAND"
            }
        }
    }
}
  • Change input
  notepad $PROFILE
# if an error is given for previous command
New-Item -Path $PROFILE -Type File -Force
  • Add this to profile
oh-my-posh init pwsh | Invoke-Expression
  • Reload terminal again
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"
  • Open profile again
 notepad $PROFILE
  • Add this to profile
oh-my-posh init pwsh | Invoke-Expression

<!-- Add this new line -->
oh-my-posh init pwsh --config 'C:\Users\bwdev121\Documents\WindowsPowerShell\cinnamon.omp.json' | Invoke-Expression 
  • Reload terminal again
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"

if you get an error run this

Install-Module -Name PSReadLine -Force -AllowClobber -Scope CurrentUser
  • Reload terminal again
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"

and you should be in business