Skip to content

Non-standard install of PowerShell does not load at session opening  #3977

Closed
@sangafabrice

Description

@sangafabrice

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Hi,
When starting a new session of vscode-powershell, the default powershell execution path is used C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe although a non-standard install location was set.
Here is how the extension is set in settings.json:

{
  "powershell.powerShellAdditionalExePaths": [
      {
          "exePath": "X:\\Pwsh\\7\\pwsh.exe",
          "versionName": "PowerShell Core 7"
      }
  ],
  "powershell.powerShellDefaultVersion": "PowerShell Core 7",
}

Assuming that the non-standard location points to the PowerShell Core 7.2.3 executable, this is what is returned from the PowerShell Integrated Console instead:

PS > $PSVersionTable.PSVersion.Major
5

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.67.1
da15b6fd3ef856477bf6f4fb29ba1b7af717770d
x64

Extension Version

ms-vscode.powershell@2022.5.1

Steps to Reproduce

  • Opens Visual Studio Code: code . --extensions-dir "X:\extensions"
  • Start Powershell Integrated Console

Visuals

Resume Preview

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions