Skip to content

Get session menu doesn't show what we defined in powershell.powerShellAdditionalExePaths #3978

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
frankchen76 opened this issue May 13, 2022 · 7 comments
Closed
6 tasks done
Labels
Issue-Bug A bug to squash. Resolution-Answered Will close automatically.

Comments

@frankchen76
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

for recent update, I no longer see what I defined in powershell.powerShellAdditionalExePaths showed up from session menu. the below is what settings I have

    "powershell.powerShellDefaultVersion": "PowerShell 5.1",
    "powershell.powerShellAdditionalExePaths":[
        {
            "exePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
            "versionName": "PowerShell 5.1"
        },
        {
            "exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
            "versionName": "PowerShell 7"
        }
    ]

I don't see those options are displayed at session menu below:
image

when I checked my settings, I also see the below yellow line to indicate the error which I've never seen before
image

any ideas how to correct that?

PowerShell Version

PS C:\AzureDevOps\PFEProjects-Private\PS-Samples> $psversiontable

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.22000
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

C:\AzureDevOps\PFEProjects-Private\PS-Samples>code --version
1.67.1
da15b6fd3ef856477bf6f4fb29ba1b7af717770d
x64

Extension Version

Steps to Reproduce

include the below JSON into settings

    "powershell.powerShellAdditionalExePaths":[
        {
            "exePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
            "versionName": "PowerShell 5.1"
        },
        {
            "exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
            "versionName": "PowerShell 7"
        }
    ]

click "Command palette" -> "PowerShell:Show Session menu", I should be able to see above options.

Visuals

No response

Logs

No response

@frankchen76 frankchen76 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
@sangafabrice
Copy link

@frankchen76, here's a solution: Issue #3977. Change the settings.json this way:

"powershell.powerShellAdditionalExePaths": {
    "PowerShell 5.1": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "PowerShell 7": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
}

@andyleejordan
Copy link
Member

Sorry about that, I think this was an unexpected change in behavior due to #3919 (but now you can do this in the GUI!)

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

@andschwa maybe this should actually be a new setting name so we can flag the old setting name/style as deprecated?
image

@andyleejordan
Copy link
Member

It's a little late now 🤷

@frankchen76
Copy link
Author

@frankchen76, here's a solution: Issue #3977. Change the settings.json this way:

"powershell.powerShellAdditionalExePaths": {
    "PowerShell 5.1": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "PowerShell 7": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
}

@sangafabrice, thanks for your help. I confirmed that your suggestion works fine on my side.
image

@ghost ghost closed this as completed May 15, 2022
@ghost
Copy link

ghost commented May 15, 2022

This issue has been marked as answered and has not had any activity in a day. It has been automatically closed for housekeeping purposes.

@ghost ghost moved this to Done in American Pharoah May 15, 2022
@andyleejordan andyleejordan changed the title Get session menu doesn't show what we defined in powershell.powerShellAdditionalExePaths Get session menu doesn't show what we defined in powershell.powerShellAdditionalExePaths May 20, 2022
@andyleejordan andyleejordan pinned this issue May 20, 2022
@cardin
Copy link

cardin commented May 27, 2022

v2022.5.1 of the Extension has not updated the documentation.

😅 took me a long while of digging before I found this GitHub Issue that mentions what the new syntax for the field was.
image

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-Answered Will close automatically.
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants