Updating to PowerShell v7 (slightly offtopic perhaps)

As I've only just got round to looking at this myself (thanks to a bunch of senior people not attending a project meeting - a sternly worded email is on its way!), I thought I'd just let people know about PowerShell v7 since it can be of use for certain kinds of processing (and particularly on Windows).

Microsoft are moving away from the original version of PowerShell that is Windows-only to a newer "PowerShell Core" that is cross-platform. v6 was the first version but that is now superseded by v7 which has some long wished-for features & on Windows, also can replace the older v5. (v6 couldn't do everything v5 could on Windows).

Possibly the thing that would most impact Node-RED users is that || and && pipe characters are finally supported bringing PS into line with other command shells (including cmd.exe). So you no longer have to worry about using PS with a command line that runs 2 commands - e.g. npm update && node-red - previously, if using PowerShell (on Windows say), you would have had to rewrite that as npm update; node-red and actually even that does not have quite the same meaning.

If you don't know PS, it is build around Microsoft's Dot.Net and so handles .net libraries very well. It is also a streaming/piped language so, for example, reading a massive CSV or Excel file (or DB query) and processing it row-by-row can be done in a very memory efficient way without intermediate variables.

On Windows, you can make PS your default shell which is recommended since it has lots of command aliases that are similar to Linux commands. You can also make it the default terminal for VScode.

If you want to upgrade or install for yourself, you will find a guide here:

1 Like

Thanks Julian for taking the time, it's hard to keep on-top of all the changes that take place in different areas. Uniformity to some degree is a great help in not wasting time remembering different syntax's.


1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.