Using chocolaty choco install oh-my-posh
USing powershell Install-Module oh-my-posh -Scope CurrentUser
Using winget winget install JanDeDobbeleer.OhMyPosh -s winget
Might need to uninstall existing verson of PSReadLine
- Run using cmd:
powershell -NoProfile -NonInteractive -Command "Uninstall-Module PSReadLine -AllVersions -Force -Verbose"
Install-Module -Name PSReadLine -RequiredVersion 2.2.2
Install-Module -Name Terminal-Icons
Install-Module -Name z
Edit by running code $profile
oh-my-posh init pwsh --config "F:\Others\Termial\powershell\the-unnamed-royz.json" | Invoke-Expression
# remove it first because already imported version clashes with the new verion
Remove-Module -Name PSReadLine
# Install With 'Install-Module -Name PSReadLine -RequiredVersion 2.2.2'
Import-Module -Name PSReadLine
# Install with 'Install-Module -Name Terminal-Icons'
Import-Module -Name Terminal-Icons
# Install with 'Install-Module -Name z'
Import-Module -Name z
# Enable prediction
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
$env:POSH_GIT_ENABLED = $true
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "right",
"segments": [
{
"properties": {
"always_enabled": true,
"threshold": 500,
"style":"roundrock"
},
"style": "plain",
"template": " <#d0d61c>\ufa1e {{ .FormattedMs }}</> ",
"type": "executiontime"
}
],
"type": "rprompt"
},
{
"alignment": "left",
"segments": [
{
"foreground": "#2bd0d9",
"properties": {
"style": "full"
},
"style": "plain",
"template": "{{ .Path }} ",
"type": "path"
},
{
"foreground": "#e88412",
"properties": {
"branch_icon": "\ue0a0 "
},
"style": "plain",
"template": "{{ .HEAD }}",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"style": "plain",
"template": "{{ if gt .Code 0 }}<#e93a13>\u276f</>{{ else }}<#12c32f>\u276f</>{{ end }} ",
"type": "text"
}
],
"type": "prompt"
}
],
"version": 2
}