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? powershell powershell

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


Set-Theme is an oh-my-posh V2 cmdlet; you're likely running V3. Provided you followed the rest of the setup correctly, you can simply replace Set-Theme Paradox with Set-PoshPrompt -Theme Paradox.

More info here: https://ohmyposh.dev/docs/upgrading


Try this:

  1. First, ensure that you are using an administrative shell and install with powershell.exe (or Windows Terminal)

  2. Install Powershell Get. Powershell Get MS

The PowerShell Gallery is the central repository for PowerShell content. In it, you can find useful PowerShell modules containing PowerShell commands and Desired State Configuration (DSC) resources.

Install-Module -Name PowerShellGet -Force
  1. Install PS Readline PS Readline GitHub

This module replaces the command line editing experience of PowerShell for versions 3 and up. It provides: Syntax coloring; Simple syntax error and more (watch link upside)

Install-Module PSReadLine
  1. Now, changes your executions policies to Bypass. Read more Here

An execution policy is part of the PowerShell security strategy. Execution policies determine whether you can load configuration files, such as your PowerShell

Set-ExecutionPolicy Bypass

3.1 Check your execution policy:

Get-ExecutionPolicy
  1. Finally, try or reinstall your oh-my-posh. Link oh-my-posh here
Install-Module oh-my-posh -Scope AllUsers

and before replace your existing prompt

Edit $PROFILE in your preferred PowerShell version and add the following line. Autocompletion is available so it will loop through all available themes.

4.1 if you have VSCode

Code $PROFILE

4.2 and write

Set-PoshPrompt -Theme 'posh-theme-here'