Install Powerline for Powershell
Anderson Gama
Posted on May 16, 2021
I always used Powerline in Linux but I didn't know it had an option for Windows, very nice :-)
Powerline provides a customized command prompt experience providing Git status color-coding and prompts.
Set execution policy
Get-ExecutionPolicy -List
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine
Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install Git on Windows
choco install git wget unzip code
Install Powerline in PowerShell
Using PowerShell, install Posh-Git and Oh-My-Posh:
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
If you are using PowerShell Core, install PSReadline:
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
In your PowerShell profile, add the following to the end of the file and Customize your PowerShell prompt:
echo 'Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme paradox' > $PROFILE
List of themes: https://ohmyposh.dev/docs/themes/
Powerline fonts: https://github.com/powerline/fonts
cd ${HOME}\Downloads\
wget -c https://github.com/powerline/fonts/archive/refs/heads/master.zip
unzip .\master.zip
Set-ExecutionPolicy Bypass -Scope Process -Force; powershell ${HOME}\Downloads\fonts-master\install.ps1
Set Ubuntu Mono derivative Powerline as your font:
{
"colorScheme": "Solarized Dark",
"commandline": "powershell.exe",
"fontFace": "Ubuntu Mono derivative Powerline",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
Source:
https://github.com/powerline/powerline
https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup
💖 💪 🙅 🚩
Anderson Gama
Posted on May 16, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
watercooler Why does a reboot make your PC run SO much faster than running all the cleaning tools you can possibly imagine?
November 30, 2024