Since I switched to Windows last year I'm using Microsoft's Powershell as my main shell environment (on my personal laptop). At first I didn't really look into Powershell's feature until around half a year ago when I found the motivation to work on a nicer prompt and spent some time migrating my ZSH profile to Powershell. I ended up creating a different profile that suits my needs, and that I had lot of fun building.

That's how my prompt looks:

My custom Powershell prompt

It has the following features:

  • Used for both Windows and Linux subsystem
  • Current directory
  • A dynamic "main directory" used to specify the context
  • Git branch
  • Current time
  • Last command success/failure
  • Admin user label

That was a cool and fun way to learn more about Powershell features, after spending all my life with sh, bash, and zsh it was refreshing to try out a different way to write shell scripts.

Some implementation details

Left and right prompt

That's a very common feature in other...