vscode-powershell: Command 'PowerShell: Show Extension Terminal' resulted in an error (command 'PowerShell.ShowSessionConsole' not found)

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed 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

The current version of the PowerShell plugin does not load when I open .ps1 files any longer. When I try to launch the integrated terminal with PowerShell: Show Extension Terminal from the command pallete, I get the following error (re-stated from title):

Command ‘PowerShell: Show Extension Terminal’ resulted in an error (command ‘PowerShell.ShowSessionConsole’ not found)

Rolling back to the prior version fixes this (albeit with the old PowerShell Integrated Console name for the terminal). I’ve found at least one other person today experiencing the same issue. I’ve also tried the related PowerShell: Restart Current Session command which results in a similar “command not found” error.

Recently-created issue #4135 seems like it could be related although it’s for a specific plugin feature. My issue here is that the terminal not launching causes the plugin to entirely not function.

PowerShell Version

> $psversiontable

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

> code --version
1.70.1
6d9b74a70ca9c7733b29f0456fd8195364076dda
x64

Extension Version

> code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2022.7.2

Steps to Reproduce

  1. Open .ps1 file for editing.

  2. No plugin features are available. Quick evidence of this is no syntax checking is performed against the opened file.

  3. Try to open the plugin terminal with the PowerShell: Show Extension Terminal pallete command. Modal dialog with the following error is displayed:

    Command ‘PowerShell: Show Extension Terminal’ resulted in an error (command ‘PowerShell.ShowSessionConsole’ not found)

Visuals

No response

Logs

No logs are generated when running PowerShell: Show Extension Terminal from the command pallete. I set logging to Diagnostic before attempting this.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I don’t think the workspace file will help at this point. The issue seems to have been that powershell.cwd was not set, and I was not prompted to set this until after a few attempts of trying to get the plugin to load. Nonetheless let me revert the fix and see if I can reproduce the lack of prompt again with this, if I can I will share it.

My workspace is also not completely empty as the other person mentioned in their reproduction of the issue.

Sorry, saw this on Reddit and it looked like what I experienced. My issue is actually a dupe of #4102