Terminal
This is a fairly simple and straightforward step by step guide to setup Oh My Posh and few other usefull utilities on Powershell.
I'll not deep dive and explain what does what & why install something. You can do a simple google to find out that. Good luck!
If you are on Windows 10, you'll most likely want to do the following steps first,
Install Windows Terminal
Install Powershell
Set Powershell as the Default Profile of Windows Terminal
Open Windows Terminal
Hit
ctrl+,

Rest is same for Win 10 & 11,
Install a Nerd Font of your choice
You can see preview of the fonts at https://www.programmingfonts.org/
Set your newly installed font as the default of
Windows TerminalIf you use terminal inside vscode, set value of
"terminal.integrated.fontFamily"with your fontInstall Oh My Posh
winget install JanDeDobbeleer.OhMyPosh -s wingetedit Powershell profile $PROFILE and paste the following
Replace
user-namewith your Windows user name &theme-namewith your preferred theme in the command Runcode $PROFILEto open in VSCode ornotepad $PROFILEto open in notepad
oh-my-posh --init --shell pwsh --config C:\Users\user-name\AppData\Local\Programs\oh-my-posh\themes\theme-name.omp.json | Invoke-ExpressionInstall Terminal-Icons
Install-Module -Name Terminal-Icons -Repository PSGalleryImport Terminal-Icons in $PROFILE
Import-Module -Name Terminal-IconsInstall PSReadLine
Install-Module PSReadLine -AllowPrerelease -ForceImport PSReadLine in $PROFILE
Import-Module PSReadLineTo get better list view and edit mode, paste the following in $PROFILE
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
You can edit and remove commands from powershell history by modifying $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
Credits
https://0xdf.gitlab.io/2018/11/08/powershell-history-file.html
https://www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal
Last updated