Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

  1. Both Windows and PowerShell are products of Microsoft, it makes no sense not to give windows update the update that migrates PowerShell 5 to PowerShell 7.
  2. PowerShell 7 is better than PowerShell 5 and is backwards compatible, it also makes no sense why the better one doesn't automatically deprecate the old one, because it means Microsoft has to maintain PowerShell 5 while developing PowerShell 7, this doesn't sound very efficient.
  3. I think that every script or program that calls powershell.exe should call pwsh.exe instead.

All I'm saying is that I would like an easy way to migrate from PowerShell 5 to PowerShell 7 in a way that every script/scheduled task/program that calls powershell.exe will instead use PowerShell 7 (pwsh.exe).

Yes, I am aware that are some changes and some cmdlets have been removed between the versions, so not all PowerShell 5 scripts will work the same and some errors might appears (and that PowerShell 7 requires newer .NET) , but still, my point stands - Currently I find it hard to migrate from PowerShell 5 to PowerShell 7 and I wish there was an easy way considering that Microsoft develops Windows and PowerShell.
Windows should ship PowerShell 7 out-of-the-box (even in LTSC versions) and update it using Windows Update.

You must be logged in to vote

Replies: 3 comments · 4 replies

Comment options

  1. Both Windows and PowerShell are products of Microsoft, it makes no sense not to give windows update the update that migrates PowerShell 5 to PowerShell 7.

There is nothing that migrates from one to the other, they are separate shells.

  1. PowerShell 7 is better than PowerShell 5 and is backwards compatible, it also makes no sense why the better one doesn't automatically deprecate the old one, because it means Microsoft has to maintain PowerShell 5 while developing PowerShell 7, this doesn't sound very efficient.

While it makes every effort to be backward compatible there are many breaking changes, different command line options, parameter interpretations, default behaviours, character encodings etc.

  1. I think that every script or program that calls powershell.exe should call pwsh.exe instead.

That should be entirely a choice for the user.

There is a proposal to ship PowerShell 7 alongside PowerShell 5, but at the moment it is still a proposal. If you read that discussion it is not such a simple matter.

Operating systems should be about providing basic functionality, if that requires apparent duplication of function then so be it. An ARM64 version of windows has 4 complete sets of binaries, for ARM32, ARM64, x86 and AMD64. Internet Explorer coexisted with Edge for many years.

A single installation of Linux can have sh, bash, zsh, ksh, csh and more. While some are more recent than the others it does not imply that one is better than the other for a specific purpose.

The last thing in the world that anyone needs is all their powershell scripts breaking due a windows update.

You must be logged in to vote
4 replies
@Obegg
Comment options

Thank you for this detailed response.

they are separate shells.

If PowerShell 7 is not meant be replace PowerShell 5, then why develop it in the first place?
It has the same name, just different version.

@rhubarb-geek-nz
Comment options

If PowerShell 7 is not meant be replace PowerShell 5, then why develop it in the first place? It has the same name, just different version.

PowerShell 5 is based on .NET Framework and is Windows Specific and is effectively end of life.

PowerShell 7 is based on .NET Core, is multiplatform, and does not contain Windows specific code, for that it relies on the PowerShell 5 modules.

@Obegg
Comment options

end of life.

So this means something has to replace it, and that "something" is PowerShell 7, right?

@rhubarb-geek-nz
Comment options

end of life.

So this means something has to replace it, and that "something" is PowerShell 7, right?

Not really. Nothing has replaced cmd.exe, it is still there. if PowerShell 7 is shipped with Windows it will be side by side. PowerShell 5 will still exist as part of Windows for decades to come. There is too much that depends on it in the wild.

Comment options

I don't think it's possible to simply abandon powershell.exe today, primarily due to different licenses. Unlike PowerShell Core, Windows Powershell is closed-source and this code can't be used directly, only by invoking the powershell.exe process

You must be logged in to vote
0 replies
Comment options

An Opt-in (at least for now) mechanism to default all powershell.exe invocations to somehow redirect to current pwsh install, while keeping Windows Powershell installed/available, would be welcome. I could see this eventually becoming default opt-out for client OS', while server OS it would need to default to off.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.