Powershell Customization (Profiles and oh-my-posh)
This post includes some useful details on enhancing your powershell environment as well as making it intuative when inside git based projects.
- Navigate to
%USERPROFILE%\Documents\WindowsPowershell
this can be run in Win+R or useii $env:USERPROFILE\Documents\WindowsPowershell
in your powershell console.
If the folder doesn’t exist, navigate to the Documents folder on the user scope; create and open it. - Create a file in the directory named
Microsoft.Powershell_profile.ps1
; open the context menu and edit. - Add the code below to the file.
ii
is an alias forInvoke-Item
which is able to act as if you were selecting a file or folder.function Here { ii . }
- Relaunch powershell, run
Here
.
There are some other customizations available to powershell that were inspired by shell scripts.
One of them being ‘posh-git’ for ‘oh-my-posh’. The theme used below is Agnoster
.
I would show all of them
I would recommend reading this gist about how to configure PowerShell for this modification: https://gist.github.com/jchandra74/5b0c94385175c7a8d1cb39bc5157365e
Also, get Windows Terminal from MS Store… it allows for flow between each ‘shell’ (powershell, cmd, bash, etc.). Just because it looks better from my perspective! 😎 aka.ms/terminal
A list of fonts I recommend from powerline fonts
You should be fine so long as one of these names are shown in the font face display name. If it specifically says ‘for Powerline’, you should be fine. - They have also been left out of this list.
- CaskaydiaCove
- DejaVu Sans Mono
- Droid Sans Mono
- IBM 3270