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.
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:
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.
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?
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.
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.