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 Proof of Concept with Windows Terminal

Posted on July 8, 2019August 16, 2019

I recently updated my Windows 10 systems to the 1903 release. One of the reasons is that I wanted to try out the new Windows Terminal preview. You can find it in the Windows Store. This is bleeding edge stuff and far from complete but promises to be a great addition. Now you will be able to have all your command terminals, in one tabbed application and easily be able to switch between them. As I said, this is far from being a finished and polished product. Right now, if you want to add a new profile, that is another terminal, you have to manually edit a json file. If you have VS Code installed, the file will open in that.  Otherwise, I'm assuming you'll get whatever application is associated with the .json extension.

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!

I don't mind the json format because that is something that I can consume with PowerShell. While some people are hoping for a graphical profile editor, I'm just as happy using PowerShell. To that end I've thrown together a function to add a new profile to your profiles.json file. Like Windows Terminal, this is definitely a work in progress and far from complete. But I can foresee writing a module to manage Windows Terminal once it matures a bit more.

For now, you can find the function as a Github gist.

From what I can tell, the json file structure is case-sensitive, so if you want to set a parameter that has a ValidateSet attribute, let PowerShell tab complete the value. Right now, I'm using the color schemes in the default profile. At some point it would make sense, and not be difficult, to pull defined schemes from the profiles.json file. The command will give you some nice verbose information and supports -WhatIf. I've also added functionality to make a copy of profiles.json in the same directory but with a filename like profiles_2019-07-08T11_10_48.json.

With the function you can create a new terminal profile like this:

New-WindowsTerminalProfile -ProfileName Netsh -Commandline "cmd /c netsh" -Icon CMD -CursorShape vintage -CursorColor '#008080' -Opacity 0.8 -EnableOpacity -FontSize 18 -verbose

Here's the result:

A new Windows Terminal tab

For now, I would edit the profiles.json file to fine-tune the terminal settings.

I'm hoping that Windows Terminal continues to develop and I look forward to creating PowerShell commands to make it even more awesome! Enjoy.


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

4 thoughts on “A PowerShell Proof of Concept with Windows Terminal”

  1. Dustin Marzolf says:
    July 10, 2019 at 8:55 am

    Some one already beat you to it. Search MSTerminalSettings on powershellgallery.com. I just ran across the module yesterday. Surprisingly, your function looks a lot like one of their functions. Great minds think alike?

    1. Jeffery Hicks says:
      July 10, 2019 at 12:02 pm

      Someone else pointed that out to me as well. That project is much further along so I doubt I’ll continue down this road. Plus Chris knows his stuff.

  2. MS says:
    July 10, 2019 at 12:43 pm

    Thanks for the informative article, I’ll have to check it out. That said, ConEmu has been doing this for years and integrates with third-party apps/consoles such as PuTTY and Notepad++. With the Quake-style HUD it’s been my go-to console for years.

  3. Pingback: Powershell and Windows Terminal Profiles – Curated SQL

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