r/PowerShell • u/Technical_Rich_3080 • Apr 22 '26
Question PowerShell 5 vs. PowerShell 7
On Windows 11, is there any benefits for normal users to install PowerShell 7 and use it instead of PowerShell 5?
75
Upvotes
50
u/RubyU Apr 22 '26
I’ve stuck with v5 because it’s available at every customer I go to.
Dependable for my own tasks and easy to whip up a script or two that I can hand over when I leave again
74
u/WhatThePuck9 Apr 22 '26
Yes, PS 7 is better for graph and modern management.
18
u/patjuh112 Apr 22 '26
Classic is windows native, certain things only work there. Pws7 is sorta a separate product, more for modern stuff
9
u/crim981 Apr 22 '26
I have a script that checks ACLs for almost 5tb ob data. On PS5 the gci runs for about 2-3 Hours. On PS7 it takes like 30-40 Minutes. Same script. Changed nothing. So certain tasks seem to run much more efficient on PS7.
6
u/raip Apr 22 '26
Depends on what a normal user means. More than likely not though, if you're not developing or running Powershell workloads, there's no benefit.
6
u/Vern_Anderson Apr 22 '26
I've always been a firm believer in devloping at the same level as my target environment. Meaning, that if I work on servers running WIndows they are already going to have PS 5.x installed. To stay compaitble with that and not fall into the trap of using a command that potentially won't be there, to me it's just a better discipline to not use 7 if my target environment is Windows.
Do I dabble with 7? YES! but I don't really develope to that level. Anything I develope in 5 should run on 7 if it's on Windows. Non Windows environments, well you would have to tell me. I've been a Windows admin since the late 90s.
9
u/the_wonky_eyed_one Apr 22 '26
Powershell version 5 vs 7 is not really an apples to apples comparison. “PowerShell 5” is really, Windows PowerShell whereas “PowerShell 7” is PowerShell. Windows PowerShell is used by the operating system while PowerShell is optionally installed.
https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.6
7
u/technical_knockout Apr 22 '26 edited Apr 22 '26
Depends... Have a few things where "foreach-object -parallel" speeds things up a lot.. f.e when I have to pack or unpack a bunch of zip files at once.
Or sometimes when I write something to csv and need to put quotation marks on all string values it's easier on 7 than on 5.
I would consider this normal stuff (for someone working with data) compared to developing or sysadmin. AndI did both just yesterday.
3
u/robbkenobi Apr 22 '26
I think ps5 does UTF16, whereas ps7 does UTF8, so special chars can be a problem for Invoke-Rest calls.
3
u/TwilightKeystroker Apr 22 '26
More info on 5 vs 7
If you're doing policy‑as‑code, Graph automation, proactive remediations, or cross‑platform management, PS7 is a massive upgrade.
If you're running legacy Windows‑only modules, keep 5.1 but run new automations in 7.
5
u/Potato-9 Apr 22 '26
Normal users don't use powershell and if you're a powershell user just use the newest one. It's like death by a thousand cuts they fix a lot of little quality of life stuff too like default new file text encodings to utf8.
It's not just new features many existing cmdlts get new parameters.
2
u/Creddahornis Apr 22 '26
PS7 handles module conflicts better than PS5 in my experience (Graph/PNP/Entra/Exchange), and certain modules can't be installed on PS5. I use exclusively PS7, via VS Code's PowerShell Extension
Also very niche but PS5 doesn't support invoke-restmethod with the -form parameter so I had to use PS7 in a particular script I made
2
u/markdmac Apr 22 '26
Some Microsoft modules are setting PowerShell 7 as a requirement, as an example PNP requires PowerShell 7.4 or above.
The crazy thing is it does still run in 5.1 however we found it became highly unreliable. Ended up changing over to MgGraph and running in PowerShell 7 and stability returned.
I share the frustration over the demise of the ISE. I worked pretty hard to customize VSCode to look and behave the same as ISE and still preferred my snippets functionality in ISE.
One thing to keep in mind is you can code or spot troubleshoot in the ISE on a server, but just save the file and execute it in PWSH.
2
u/g3n3 Apr 22 '26
What are your goals? Everyone should be on modern supported software. That is the benefit. If you have specific goals then we can readily talk about your benefits.
2
u/Chance_Reflection_39 Apr 22 '26
I’ve been avoiding PS5.1 for over a year now. I don’t miss the ISE as I use VSCode or Cursor now.
2
u/EuphoricFly5489 Apr 23 '26
7 is much faster.
2
u/natiT Apr 24 '26
When u can go with Powershell 7 and make use of a better CMDLet set and Parallel Foreach Loops.
If u need backwards compatibility for customers use Powershell 5 but i would always recommend to use PS7
1
u/cottonycloud Apr 22 '26
There are the performance improvements, bug fixes, language changes (null operators), and built-in functions/cmdlets over the years in both PowerShell itself and .NET
1
u/jr49 Apr 22 '26
I use both interchangeably for the most part. In 5ish years of using PS daily there a few things I’ve ran into that requires one over the other. In my main machines I use PS7 (Mac and windows). On my virtual machines I use PS ISE only because I don’t want to bother installing 7 or even keeping my vscode settings on multiple installs.
On Azure Automation Account runbooks I try to use PS7 framework as much as possible.
1
u/justaguyonthebus Apr 22 '26
Absolutely. New tools and modules no longer guarantee support for V5. Security fixes, performance, bug fixes all have improved in later version. And you stop taking a dependency on V5.
1
u/nkasco Apr 22 '26
PS7 is where the modern investments are going. PS5 will stick around since it is an inbox app, but if the product team ever gets PS7 shipped as an inbox app (which is a challenge in itself for various support related reasons) I would expect PS5 to eventually be phased out.
That said, so much uses PS5 under the hood, Defender, Intune, that it's unlikely to be going anywhere anytime soon.
Use either, but know with PS7 it's based on certain .NET versions. For that reason I suggest 7.6 which is in the early cycle of LTS for .NET 10
1
u/DueBreadfruit2638 Apr 22 '26
I've been thinking of deploying PS7 to all of my endpoints. Security team has some unspecified concerns about it. It would make my life easier.
1
u/RyeonToast Apr 23 '26
I've noticed better memory management when building large reports in PowerShell 7.
1
u/Ad-1316 Apr 23 '26
update and run the latest MS product. it is better and more secure.
1
u/aries1500 Apr 23 '26
7 has a lotmof improvements, if you are using any Ai cli agents this will matter more.
1
u/heyitsgilbert Apr 24 '26
If it's that you're building for yourself or your teammates that go with 7. For end users and systems management, develop for 5. It doesn't have to be over then other. You'd miss out on a lot of the nice things in 7.
1
u/334Productions Apr 24 '26
My security team has a weird block on Powershell 5 where you can’t run scripts but they don’t have anything for Powershell 7 so Powershell 7 wins for me.
1
u/mooscimol Apr 22 '26
Try the -parallel, maybe you could cut it down to few minutes.
0
u/rjchau Apr 22 '26
On Windows 11, there is no requirement to install PowerShell 7 - it comes preinstalled.
The long and the short of it is if you are using PowerShell modules that require the "desktop" edition (i.e. version 5) then use version 5, otherwise I'd be targeting version 7. PowerShell 5 is in maintenance mode and will not receive any future updates, whereas PowerShell 7 is actively being developed.
0
u/fatal0efx Apr 22 '26
Use Powershell 7 and also *-PSResource cmdlets instead of *-Module cmdlets. Powershell 5 and *-Module cmdlets are no longer actively maintained.