The feature described in this article is also included in PowerShell Studio 5.8.230.
Some time ago, Microsoft introduced Windows Terminal, which has now replaced the default console on Windows 11 (since 22H2). Having a tabbed environment and the ability to mix and match different console applications is a great help if you write any type of console script.
PrimalScript 2023 (8.1.187) has a button on the ribbon allowing you to run your script directly in Windows Terminal. The hotkey is Ctrl+Shift+F8.
Ideally, when you write a script, you run it, nod approvingly, and roll it out to whoever is supposed to use it. In reality, it is not quite like that. Anything more complex than “Hello World” will have “Uncertainties”, “Variances”, or “Undiscovered Features”—commonly known as “Bugs”.
Running things in the debugger, with breakpoints, and examining variables at specific points is always helpful. But sometimes, that does not work. The debugging process may alter the application’s timing, or your script may take too long and process too much data for you to sit and execute it step-by-step. That is when you usually resort to running a script in the console for post-mortem debugging, meaning you poke around in the variables to see what happened after your script died or seemingly finished successfully—but somehow did not do what it was designed to do.
Windows Terminal provides a great way of doing just that. You can run your scripts from PrimalScript, and each iteration opens in a new tab enabling you to investigate differences from one execution to the next very easily.
Additionally, if you need your script to perform the same tasks in Windows PowerShell and PowerShell 7, Windows terminal will have both tabs in the same window, making it easier to compare output and variables in both settings. The Preview version of Windows Terminal has additional tab tear-out and splitting capabilities that will also come in handy for this purpose.
While using Batch files or VBScript/JScript is no longer fashionable, plenty of legacy scripts still need to be maintained, updated, and tested. Windows Terminal supports a command console, thereby PrimalScript can also run these types of scripts in Windows Terminal.
Feedback
As always, please let us know what you think in the comments below or in the SAPIEN Support Forum.