(Windows users only) Allow all powershell scripts to be run (Note: This will prevent Powershell from stopping you from running (potentially harmful) scripts) - Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "Unrestricted"
Install posh-git
- Install-Module posh-git -Scope CurrentUser
Install oh-my-posh
- winget install JanDeDobbeleer.OhMyPosh -s winget
.
(Note: if you've previously installed oh-my-posh
using the powershell module, you will need to migrate)
Open up the file $profile
in your text editor of choice (VScode: code $profile
, Notepad: notepad $profile
)
Add these lines:
Import-Module posh-git
oh-my-posh init pwsh --config ~/pwsh10k.omp.json | Invoke-Expression
Run curl https://raw.githubusercontent.com/Kudostoy0u/pwsh10k/master/pwsh10k.omp.json --output pwsh10k.omp.json
(Windows users replace curl
with curl.exe
)
Run Copy-Item -Path pwsh10k.omp.json -Destination $HOME
Restart terminal and you should see a pretty prompt!
Edit pwsh10k.omp.json
(Notepad: notepad ~/pwsh10k.omp.json
, VScode: code ~/pwsh10k.omp.json
) and change as you see fit (how to configure a theme?)