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

PWSH explecit error #764

Closed
ynhhoJ opened this issue Dec 15, 2022 · 9 comments · Fixed by #769
Closed

PWSH explecit error #764

ynhhoJ opened this issue Dec 15, 2022 · 9 comments · Fixed by #769
Labels
enhancement New feature or request

Comments

@ynhhoJ
Copy link

ynhhoJ commented Dec 15, 2022

I've searched open issues for similar requests

Yes

Is your feature request related to a problem? Please describe.

#706

Is it possible to add a hint during an error related to pwsh?

изображение

Windows 11 has powershell (legacy version) installed by default, but Mason requires a newer version of pwsh. I could not immediately understand where exactly the error was, and after installing the powershell 7.3 version, everything worked

Code: https://github.com/williamboman/mason.nvim/pull/706/files#diff-1243700016801fd3c68dbc2d65f32bd9e12ae30b09e45031248e6e49065cf168R224-R233

Describe the solution you'd like

  1. Write to the user that he needs a new version of powershell

Describe potential alternatives you've considered

  1. Or add legacy powershell support

Additional context

No response

@ynhhoJ ynhhoJ added the enhancement New feature or request label Dec 15, 2022
@williambotman williambotman added this to Needs triage in Issue Triaging Dec 15, 2022
@asmodeus812
Copy link
Contributor

Faced same issue, why is that such a hard requirement for this specific package, can we not use the older version. I also faced the same issue on shellcheck and lemminx.

@emPeeGee
Copy link

The same issue for me

@adriancostin6
Copy link

Facing the same issue here. Can't this just support the legacy version so us boomers don't have to install a brand new Powershell? It's an extra thing to keep in mind. This has to be documented either way, because as mentioned above, the default powershell version is still not pwsh for many systems.

@asmodeus812
Copy link
Contributor

Not only that, but this kind of completely borks support for win10 and even win11 by default which imo is bad idea. What was wrong with maybe checking which shell is available and use that instead, the more fallback options the better.

@williamboman
Copy link
Owner

Hey! Ah that's interesting, I was under the impression that the old iteration of powershell had been phased out completely by now, seeing as the initial announcement was in 2017 IIRC. There's no particular reason to use pwsh, reverting back to powershell.exe should be perfectly fine

@williamboman
Copy link
Owner

I believe #769 fixes this by reverting the change. If it does not let's reopen.

@ynhhoJ
Copy link
Author

ynhhoJ commented Dec 19, 2022

@williamboman , it is possible to do like this:

  1. If user doesn't have pwsh - use powershell
  2. If user have pwsh - use pwsh

@williamboman
Copy link
Owner

williamboman commented Dec 21, 2022

@williamboman , it is possible to do like this:

  1. If user doesn't have pwsh - use powershell
  2. If user have pwsh - use pwsh

I've wanted to avoid doing this, but it seems like it's the only option. I was hoping Windows environments would be more predictable haha. Mason doesn't really call into Powershell that much, and all cmdlet invocations should be fully cross-compatible between Powershell versions (for now..).

edit: Done in #782

@Cluster7ck
Copy link

Cluster7ck commented Dec 22, 2022

Just for documentation purposes:
I created a script at ~/pwsh.sh with the following content as a workaround:

powershell "$@"

Wanted to create an issue for this, but found it was just fixed 😄 Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

6 participants