Using Windows Terminal for PowerShell

The Windows Terminal application has been out for a while now and it’s one of the things (Next to my Edge Browser, Teams, and Outlook of course 🙂 ) that I start after logging into my laptop. It’s a Terminal application that allows you to have multiple PowerShell (Or cmd, ssh, or even WSL Linux sessions) open. In this blog post, I will show you some configuration settings to make it your go-to app for command-line stuff 🙂

What is Windows Terminal?

“Windows Terminal is a new, modern, feature-rich, productive terminal application for command-line users. It includes many of the features most frequently requested by the Windows command-line community including support for tabs, rich text, globalization, configurability, theming & styling, and more.

The Terminal will also need to meet our goals and measures to ensure it remains fast and efficient and doesn’t consume vast amounts of memory or power.”

Installation

The preferred method is installing Windows Terminal from the Windows Store https://aka.ms/terminal , you can also install using WinGet:

winget install Microsoft.WindowsTerminal 

Starting Windows Terminal

When it’s installed, you can start it by searching for ‘Terminal’ in your Start Menu.

When started, it will look like this:

Profiles

Windows Terminal will automatically detect if you have PowerShell 5 and 7 installed and show them in the pull-down menu:

You can also see that it detected that Azure Cloud Shell is available and my WSL2 Ubuntu 20.04 installation. You can add your own profiles using the Settings menu too by selecting Add new profile on the left in which you can create a new/empty Profile or duplicate an existing one:

Personally, I have added a few SSH sessions to my VPS, PiHole, Ubiquiti EdgeRouter, Ubiquiti EdgeSwitch, and a NoProfile PowerShell v5 session (Duplicate of the PowerShell v5 Profile with the addition of a -noprofile parameter. )

The SSH sessions are just Profiles with a command-line like this:

PowerShell modules for Windows Terminal usage

There are three PowerShell modules that I use that make using Windows Terminal better:

Az.Tools.Predictor

If you do a lot of Azure PowerShell things, the module Az.Tools.Predictor (PowerShell v7.2 or higher required) will use predication and will show you cmdlet input from Azure that is used often. After installing the module (Install-module -name Az.Tools.Predictor -Force) you can add it to your sessions by running:

Enable-AzPredictor -AllSession

After this, you can start typing a part of an Azure cmdlet and it will look like this when typing “get-azs”

Posh-Git

This module is a nice way to show you, when you’re in a GitHub directory on your disk if there are any pending Git actions. In this case, there are no actions:

But after editing a file, it will show you that you have pending commits:

PSReadline

Already written about it here, but there are some new options available for it. In my PowerShell profile I added a few options for it which you can set by:

- notepad $profile
- Add the following lines:
Set-PSReadlineKeyHandler -Key Tab -Function Complete
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
- Save/Quit and start a new PowerShell session

Adding these options will make searching/typing cmdlets look like this when typing “get-mo”:

It shows your previously typed commands and you can select them from your history list.

Changing the look and feel

Windows Terminals allows customizing in a few ways, the most important of course is setting the Dark theme 😉

And you can change the color schemes:

But… The nicest one is having a wallpaper in your session, you can do this by editing the Profile in the Appearance section:

You can set a wallpaper of even an animated GIF:

Setting the Use desktop wallpaper is a bit more relaxing in your prompt than using a moving Nyan cat 😉


With the Company logo of NEXXT in it in my case 😉

Split Screen

You can use the split screen option to have two active windows in your current Profile tab, this is done by holding ALT and selecting + (To start a new default Profile) or selecting a profile from the pull-down list. This looks like this:

Or even more windows including a cmd-prompt and a WSL2 Linux one:

More information and tips/tricks

You can read more about Windows Terminal and customizing it here, read the tips/tricks and tutorials part for that. Enjoy!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.