Skip to content

Make PowerShell 7+ the default shell if it's available #110828

Closed
@TylerLeonhardt

Description

@TylerLeonhardt

Scenario

The specific scenario I want to solve for is this:

  • JS/Java/Python developer on Windows wants to use the latest PowerShell because improved shell experience
  • They install PowerShell from the Microsoft Store because it's the easiest way for them to get it and auto-update
  • They expect that the PowerShell they installed from the Store replaces Windows PowerShell as the default shell used in VS Code

NOTE: part of this assumption the user has is because PS7 already shows up as the default in Windows Terminal (if PS7 is installed)

This would be a great way for customers adoption of the latest version of PowerShell rather than using Windows PowerShell which hasn't been updated in years.

Today

Today the user can "choose their default shell" in the drop down of terminals but this does not work for PowerShell installed via the Store because the install location is different... So today, the user can only, configure their shell on windows to be "terminal.integrated.shell.windows": "pwsh" to set the shell to any PowerShell 7.

Much like Windows Terminal, VS Code could discover which PowerShell is available and use that as the default so that users can easily transition.

Design ideas

In the PowerShell extension, we wrote up this very exhaustive class that could "discover" powershell on any platform:

https://github.com/PowerShell/vscode-powershell/blob/master/src/platform.ts#L67

This includes scenarios like PowerShell installed via Store, PowerShell installed via .NET Global Tool, install via MSI... etc.

I originally showed this code to WT folks so they may have adapted it for them.

I think the "terminal.integrated.shell.windows" should still be honored if it is set for backcompat purposes.

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityterminalGeneral terminal issues that don't fall under another labelverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions