Windows Terminal - PowerShell customization via oh-my-posh/posh-git Set-Theme error?
I follow the exact tutorial of Microsoft link: enter link description here, video link: enter link description 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
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:
First, ensure that you are using an administrative shell and install with powershell.exe (or Windows Terminal)
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
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
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
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With