Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer pwsh.exe over powershell.exe in documentation #2610

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

casey
Copy link
Owner

@casey casey commented Jan 29, 2025

Fixes #2604.

@john-cd Since which version of windows is pwsh.exe installed on by default? I want to make sure it's widely available before changing the docs.

@casey casey marked this pull request as draft January 29, 2025 21:45
@john-cd
Copy link

john-cd commented Jan 29, 2025

Not the expert, but the transition from "Windows PowerShell" to cross-platform "PowerShell" started with PowerShell Core 6, GA on January 10, 2018. We are now at "Powershell 7.5": https://en.wikipedia.org/wiki/PowerShell

Now, MS designed old Windows PowerShell and new Powershell to run side-by-side.

"Windows PowerShell is the version of PowerShell that ships in Windows. This version of PowerShell uses the full .NET Framework, which only runs on Windows. The latest version is Windows PowerShell 5.1. Microsoft is no longer updating Windows PowerShell with new features." https://learn.microsoft.com/en-us/powershell/scripting/what-is-windows-powershell

So MS still ships Windows PowerShell, but for a couple of years there has been a nag message that prompts you to install cross-platform Powershell aka pwsh.exe.

So, developers could use both but most likely have upgraded to pwsh

@casey
Copy link
Owner Author

casey commented Jan 29, 2025

Hmm, interesting. @runeimp do you happen to know? I'd like to change all the docs to use pwsh.exe instead of powershell.exe, but want to make sure that pwsh.exe is available by default on enough recent versions of windows.

@runeimp
Copy link

runeimp commented Mar 11, 2025

As I understand it (guesswork based on Microsoft information which is generally deplorable) pwsh.exe (PowerShell 6+) ships with .NET Core 2.0+; or later, simply .NET. Windows 11 ships with .NET Core (simply called .NET eventually) at some point. I understand Windows 11 22H2 (released September 2022) was the first version with the .NET Framework 4.8.1. This MIGHT be the first version of Windows 11 that includes pwsh.exe instead of powershell.exe.

@doterik
Copy link

doterik commented Mar 12, 2025

I recently installed Windows 11 Pro 23H2 and then upgraded to 24H2 to use for various tests. On this machine, surprisingly, I didn't get pwsh installed by default (only powershell), so it might be on 0% of installations, I'm not sure...

On the other hand, for those who install and use just, I would guess that 99% of them have pwsh on their machines.

If/when you make changes, also consider:
"--completions ... [possible values: bash, elvish, fish, nushell, powershell, zsh]"

@cspotcode
Copy link

AFAIK pwsh is never installed by default. At least, I haven't heard anything to the contrary.

At the very least, installing the latest pwsh is as easy as installing just via winget:

winget install Casey.Just
winget install Microsoft.PowerShell

Maybe that's good enough? I forget which versions of Windows include winget.

@casey
Copy link
Owner Author

casey commented Mar 20, 2025

@cspotcode I think you're right. I'm not sure where I got the notion that pwsh.exe was ever installed by default. I think I just assumed that since it was new and shiny, it would eventually replace powershell.exe as the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update powershell example
5 participants