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.

  1. Navigate to %USERPROFILE%\Documents\WindowsPowershell this can be run in Win+R or use ii $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.
  2. Create a file in the directory named Microsoft.Powershell_profile.ps1; open the context menu and edit.
  3. Add the code below to the file. ii is an alias for Invoke-Item which is able to act as if you were selecting a file or folder.
    function Here {
     ii .
    }
    
  4. 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

Agnoster in Windows Terminal

A list of fonts I recommend from powerline fonts

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.