Customize PowerShell in Windows Terminal

The all-new Windows Terminal is truly amazing and packed with many features. It is also fully customizable! I highly recommend configuring Windows Terminal to have a customized background and to install Oh My Posh.

It ain’t trickin’ if you got it!

Setting a Custom Background

If you go to the settings under Windows Terminal it will open a “settings.json” file that is editable.

Settings

{
	// Make changes here to the powershell.exe profile
	"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
	"name": "Windows PowerShell",
	"commandline": "powershell.exe",
	"hidden": false,
	"fontFace": "Delugia Nerd Font",
	"backgroundImage": "C:/Users/mrjamiebowman/OneDrive/Pictures/windows-terminal-2.jpg",
	"backgroundImageOpacity": 0.4
},

Vim

I’m a die hard Vim fan and I love using Vim on a regular basis. Having Vim installed in PowerShell makes it easy to edit files.

Vim: Download

HTTPie

HTTPie is an incredible tool for PowerShell that functions similar to curl but with more functionality.

HTTPie.org

Oh My Posh!

Oh My Posh is a PowerShell module that is a theme engine for PowerShell in ConEmu and Windows Terminal. I use the Agnoster theme but there are others like Sorin, Darkblood, Avit, Honukai, Fish, Robbyrussel, Pararussel, Material, Star, and Zash.

Install-Module oh-my-posh -Scope CurrentUser

GitHub: Oh My Posh!
PowerShell Gallery: Oh My Posh!

Posh Git

Posh Git is a PowerShell module that is included in “Oh My Posh” that improves how PowerShell interacts with Git. This improves visibility of which branch is being used and what the current Git status is. Some of the other features include tab completion and the ability to tab through the remote branch names.

Install-Module posh-git -Scope CurrentUser

GitHub: Posh Git

Setting This Up

For this to work you will need to install Nerd Fonts, and update the Profile.ps1 for the user.

Profile1.ps1

For the current user, this can be created in one of two places depending upon PowerShell version, or both locations if you have multiple versions installed.

How To Create PowerShell Profile Step by Step with Examples

For PowerShell version 5.1 can be created in this path.
C:\Users\mrjamiebowman\Documents\WindowsPowerShell

For PowerShell versions higher than 5.1 you can be created in this path in.
C:\Users\mrjamiebowman\Documents\PowerShell

# oh my posh
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

# vim aliases
New-Alias -Name vi -Value 'C:\Program Files (x86)\vim\vim82\vim.exe'
New-Alias -Name vim -Value 'C:\Program Files (x86)\vim\vim82\vim.exe'

Troubleshooting

You may run into issues and what I would suggest doing is try running the Import-Modules individual. You may get an error about running an unsigned module.

Enable Running Unsigned Scripts

Set-ExecutionPolicy RemoteSigned

My Terminal

Since I do pen testing I wanted my terminal to kind of fit that image. This is what my current PowerShell terminal looks like. Heavy on the cool factor, huh?

LEAVE A REPLY

Please enter your comment!
Please enter your name here