In this tutorial, you will learn how to customize your Windows Powershell prompt like a BOSS. Out-of-the-box, you wont get any shortcuts, intelli-sense, auto-complete, or even additional GIT information within your prompt. If you want to be able to do these things within your shell and turbo-charge your Powershell productivity you will want to install some plug-ins, modules and themes. Installing the best modules will make your shell look PIMP and allow you to perform tasks quicker. It is pretty easy to trick out your shell to boost your productivity. Within about 30 minutes you can level-up your prompt and save yourself a bunch of time. If this sounds good to you, read on 🔥🔥🔥
In order to make this work, you will need to install some additional software. Specifically, you will need everything within this list (I will walk you through how to install each plugin within the tutorial 😉):
Configuring Oh My Posh
Oh My Posh is a free Powershell plug-in that will allow you to skin and theme your Powershell shell. Oh My Posh will make your shell look cool. Installing Oh My Posh is easy, run this command within an elevated Powershell prompt (e.g. opened in Admin mode):
To get the most out of Oh My Posh, you will need to configure it to work with your Powershell terminal. This is done in two phases. First, you need to register Oh My Posh to load whenever you open a new Powershell shell. To do that, within your PowerShell profile. You can edit the profile using this command:
To tell Powershell to start Oh My Posh, add this line within your profile:
C:/Code/powershell.json points to a custom JSON schema. You will need to create this file. You can customise how your shell looks within this JSON configuration file. Oh MyPosh has a lot of configuration options. You can find all of them here. The configuration file I use on my PC is shown below:
When making changes to this file, you will need to reload the terminal in order for your latest changes to be applied. You can do this by reloading the profile using this command:
You can carry on tweaking your profile until you have it looking the way that works with you. After you have your shell looking good, its time to install some additional plug-in that will make your life within Powershell easier. Let us look at those next!
Broken Interface: One issue that can ruin your nice looking terminal is broken fonts.
You will need to make sure that your Windows terminal prompt is using a font that supports glyphs. If your shell looks broken, you should install a custom font and set it as your default. You can find some fonts with glyphs here. Installing a font is easy:
You can then set it within Windows Terminal like this:
Installing Useful Plugins
The first plug-in I recommend you install is called PsReadline. This plug-in will improve your command line editing experience within PowerShell. The most useful feature of PsReadline is command autocompletion. To get autocomplete to work in your Powershell prompt, you will need to use version 2.2.0. In order to install this, you will need to use the
-AllowPrerelease. To get this working you will need to run this command first, then close your terminal and re-open it!
PowerShellGet successfully, you can install the preview version of PsReadline by running this command:
When 2.2.0 is released you can get away with using this command instead:
When you try to install
PSReadLine if you encounter an error you may need to delete the plugin and then re-install it. You can browse these files from this folder location:
Simply delete everything within this location.
Displaying GIT Status Info
If you are within a GIT directory within your shell, it is possible to display extra GIT status information within your prompt. You can add information like the branch name, or if the branch is clean or dirty.
Prettify The Terminal
Another way to pretty up the terminal is to install Terminal-Icons. You can install the module using this command:
This plugin will add additional colours and icons when you a list of files and folders within a directory.
My final profile file looks like this:
Happy Coding 🤘