Skip to content

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

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

Closed
6 tasks done
sangafabrice opened this issue May 13, 2022 · 5 comments
Closed
6 tasks done
Labels
Resolution-Answered Will close automatically.

Comments

@sangafabrice
Copy link

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

Steps to Reproduce

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

Visuals

Resume Preview

Logs

No response

@sangafabrice sangafabrice added the Issue-Bug A bug to squash. label May 13, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 13, 2022
@JustinGrote
Copy link
Collaborator

JustinGrote commented May 13, 2022

@sangafabrice thanks for opening an issue! FYI the giant yellow lines around your config should have been a clue, you're using the old syntax. Try it in the format below, it works fine for me!
image

@JustinGrote JustinGrote added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Triage Maintainer attention needed! Issue-Bug A bug to squash. labels May 13, 2022
@sangafabrice
Copy link
Author

sangafabrice commented May 13, 2022

It works perfectly. Thank you. @JustinGrote

@ghost ghost added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels May 13, 2022
@andyleejordan
Copy link
Member

Related to change made in #3919

@andyleejordan andyleejordan added Resolution-Answered Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels May 13, 2022
@chawyehsu
Copy link

chawyehsu commented May 27, 2022

Related to change made in #3919

This is a BREAKING CHANGE and sadly there is no note elaborating this change. I believe a seamless migration stategy needs to be implemented, otherwise more newcomers could be missled by old documentation of this setting.

https://docs.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/using-vscode?view=powershell-7.2#adding-your-own-powershell-paths-to-the-session-menu=
https://stackoverflow.com/questions/61505287/
https://draith.azurewebsites.net/?p=400

@ghost
Copy link

ghost commented May 27, 2022

Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead.

@andyleejordan andyleejordan pinned this issue Jun 2, 2022
@andyleejordan andyleejordan unpinned this issue Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Will close automatically.
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants