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

Feature request: add usePwsh helper for PowerShell 7+ #785

Closed
ShGKme opened this issue Apr 19, 2024 · 3 comments · Fixed by #790
Closed

Feature request: add usePwsh helper for PowerShell 7+ #785

ShGKme opened this issue Apr 19, 2024 · 3 comments · Fixed by #790

Comments

@ShGKme
Copy link
Contributor

ShGKme commented Apr 19, 2024

There is a new usePowerShell helper for Windows PowerShell v5 in zx.
But Microsoft is no longer updating Windows PowerShell with new features since 2016 (source).

Now there is new PowerShell v7: cross-platform, open-source.
See also: Differences between Windows PowerShell 5.1 and PowerShell 7.x / PowerShell executable changes.

The only difference with usePowerShell is that it should use pwsh as executable instead of powershell.exe.

What about adding usePwsh helper similar to usePowerShell? If it's fine, I have a PR ready.

@antongolub
Copy link
Contributor

antongolub commented Apr 19, 2024

Seems reasonable. But do we need a separate method? We can check pwsh bin first and if not found then fallback to powershell.exe.

@ShGKme
Copy link
Contributor Author

ShGKme commented Apr 19, 2024

But do we need a separate method? We can check pwsh bin first and if not found then fallback to powershell.exe.

Though there is a backwards compatibility mode, pwsh is not fully compatible with powershell.exe. Actually, that is also the reason why Microsoft renamed it to pwsh to have a simple deterministic way to run a specific version.

So I'm not sure it would be expected for users to run pwsh as powershell even it is available.

@antongolub
Copy link
Contributor

@ShGKme,

Are you ready to create a PR?

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 a pull request may close this issue.

2 participants