vscode-powershell: Intellisense on Windows: PowerShell cmdlets is not working

System Details

  • Operating system name and version: Windows 10 1709
  • VS Code version: Version 1.19.3 x64
  • PowerShell extension version: 1.5.1
  • Output from $PSVersionTable: See below
Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ code -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

$pseditor.EditorServicesVersion
Empty line - nothing was output

code --list-extensions --show-versions
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ code --list-extensions --show-versions
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.16299.98
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.98
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Intellisense for PowerShell cmdlets is not working.

Attached Logs

Logs folder is empty! However if I enable developer tools in Help menu, I can see this:

/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056 [ms-vscode.PowerShell]Cannot read property 'text' of undefined
e.$onExtensionRuntimeError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056 TypeError: Cannot read property 'text' of undefined
	at HelpCompletionFeature.onEvent (C:\Users\mark\.vscode\extensions\ms-vscode.powershell-1.5.1\out\src\features\HelpCompletion.js:34:100)
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:238)
	at e.$acceptDirtyStateChanged (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:432:782)
	at t.e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:516:87)
	at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:580)
	at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:270)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:356:206
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:358:204
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:85:988
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:218)
e.$onExtensionRuntimeError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056 [ms-vscode.PowerShell]Cannot read property 'text' of undefined
e.$onExtensionRuntimeError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056 TypeError: Cannot read property 'text' of undefined
	at HelpCompletionFeature.onEvent (C:\Users\mark\.vscode\extensions\ms-vscode.powershell-1.5.1\out\src\features\HelpCompletion.js:34:100)
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:238)
	at e.$acceptDirtyStateChanged (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:432:782)
	at e.$acceptModelSaved (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:432:565)
	at t.e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:516:87)
	at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:580)
	at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:270)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:356:206
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:358:204
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:85:988
e.$onExtensionRuntimeError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4056

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (8 by maintainers)

Most upvoted comments

You will need to let the extension start but then can hit the “x” button to close the Integrated Console. NOTE: don’t hit the trash icon as that will kill the extension 🙂

image

(ignore the debug logging 😄 )

Feel free to open an issue to make this configurable.

btw @markallisongit, is the original issue fixed for you (just wondering if we can close this issue)!

@nicolaigj based on your screenshot, it looks like the PowerShell extension is not started.

Can you try opening the command pallet (ctrl+shift+p) and running “PowerShell: Restart Current Session”?

Also, could you switch your log level to Diagnostic? That will give us another log file if PowerShell is failing to start.

This error:

Cannot read property 'text' of undefined
	at HelpCompletionFeature.onEvent (C:\Users\mark\.vscode\extensions\ms-vscode.powershell-1.5.1\out\src\features\HelpCompletion.js:34:100)

has been fixed and will appear in the next drop 1.6.1. However, there are likely many causes of Intellisense not appearing so YMMV.

Hoping replies via email work. It was user error for me in the end. Even once you install the PowerShell extension for whatever reason you need to click Reload. When I did this all works really well now. May not be everyone’s case but hope this helps.

Best regards,

Ryan Pool

On Sat, 24 Mar. 2018, 10:26 pm Mark Allison, notifications@github.com wrote:

Very interested to know when this might be fixed. I’ve got a new laptop and the same issue has appeared there too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PowerShell/vscode-powershell/issues/1189#issuecomment-375875414, or mute the thread https://github.com/notifications/unsubscribe-auth/AfL5AD8_thtLLrG736ZairLJ4s5xKmljks5thi1pgaJpZM4R4kRT .

Same issue here on Windows 8.1, Visual Studio Code v1.20.1, PS Extension v1.6.0, and another colleagues using Win10. Tab auto-complete on common PS cmdlets doesn’t seem to work… for example get-childitem… but any cmdlet really. I found a similar article in 2016 of this being fixed, but it seems to have returned? Any word on an ETA for a fix?