PrimalScript: Did you know about Alt-X?

In the versions of PrimalScript that support PowerShell, you’ve likely executed your PowerShell scripts completely within the editor. You can configure the editor to capture the output to a tab or to new PowerShell session. But did you know you don’t have to run the entire script?

Often when developing PowerShell script, you may want to try a single PowerShell expression, or perhaps a short section. In Primalscript 2007 highlight the PowerShell commands you want to execute and press Alt-X. Only those lines of PowerShell code will be executed and output captured.

One thing to be aware of, as I always forget, is to grab all the lines of code you need. For example, I might set a variable at the beginning of the script and then want to test a few lines toward the end of the script. If I just grab the last few lines, I’ll get an error.  Just remember to either temporarily copy the lines to the same section of the script, or comment out the intermediate lines you don’t want to execute.

If you need a copy of PrimalScript to see for yourself, download a 45-day evaluation copy from Remember you’ll need at least PrimalScript 2007 Professional for PowerShell support.