Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

A PowerShell Windows Terminal Toolbox

Posted on May 5, 2020

wt-iconLast week I shared some PowerShell code I had been using to manage different aspects of Windows Terminal. I also had posted a script to backup my Windows Terminal settings file.  With all that code, plus other ideas brewing, it only made sense to bundle everything together into a PowerShell module. The module, WTToolBox should run on Windows systems under Windows PowerShell 5.1 or PowerShell 7. I'm assuming you also have Windows Terminal installed. If you import the module and don't have Windows Terminal installed you'll get an warning message. You can install the module from the PowerShell Gallery.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!
Install-Module WTToolBox

The module's repository is at https://github.com/jdhitsolutions/WTToolbox. You are encourgaged to take a few minutes to look at the README file.

WT Variables

One of the main additions is that when you import the module, it will create global variables.wt-variables

The variables make it easier to see what is in the defaults.json file and your settings.json file. The latter variable, $WTSettings, has been customized with additional features.

wtsettingsIt will show the computer name, the date the settings.json file was last updated and when the object was refreshed. If you make a change to settings.json, you can refresh this object.

$wtsettings.refresh()

I find these objects handy when I want to check things without having to open files.

WT Keybindings

The other addition to the module is an easy way to see key bindings.  The Get-WTKeybinding command will go through the defaults.json and settings.json file to create a set of custom objects that show you your Windows Terminal keybindings.  If you have a keybinding in settings.json that replaces a key combo in defaults.json, your setting takes precedence.

I'm bending best practices a bit with this command. Normally, functions should do one thing and write one type of object to the pipeline. And by default that is what this command does. But I added a -Format parameter that will let you format the results as a list, table or send to Out-Gridview.

wtkeybindings

The formatted output groups key bindings by source, i.e. default or settings. Yes, you could have done the same thing, but I wrote this thinking some people might run it who aren't really PowerShell users.

I hope you'll give the module a try and let me know what you think. Please post problems or suggestions in the GitHub Issues section of the module's repository.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

3 thoughts on “A PowerShell Windows Terminal Toolbox”

  1. Pingback: PowerShell Helper Scripts for Windows Terminal • The Lonely Administrator
  2. Pingback: ICYMI: PowerShell Week of 08-May-2020 – 247 TECH
  3. Pingback: ICYMI: PowerShell Week of 08-May-2020 | PowerShell.org

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d