I've just started using Visual Studio Code for working with Powershell. I've loaded the powershell extension, and when I connect to Exchange auto-completion of cmdlets works in the integrated powershell window, but it doesn't work in the to peditor panel. How can I get cmdlet auto-complete or intellisense to work in the editor panel? Thank you!
You don't say if you configured you VSCode environment to make PowerShell the default language. If you look in the right hand corner of the editor, it will tell you what language is currently set to. Show your user settings. In your user settings, you should have lines like this in place (just an example from mine, tweak as needed for your use case - see the docs for details on the VSCode user settings.)…
"extensions.autoUpdate": true,
"files.defaultLanguage": "powershell",
"powershell.scriptAnalysis.enable": true,
"powershell.startAutomatically": true,
"powershell.integratedConsole.focusConsoleOnExecute": false,
"powershell.enableProfileLoading": true,
"powershell.developer.editorServicesLogLevel": "Verbose",
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.mouseWheelZoom": true,
"editor.tabCompletion": "on",
"editor.suggestSelection": "first",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
"terminal.integrated.rightClickBehavior": "default",
"window.title": "${activeEditorLong}",
"powershell.powerShellExePath": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"powershell.scriptAnalysis.settingsPath": "ScriptAnalyzerSettings.psd1",
"workbench.startupEditor": "newUntitledFile",
"editor.cursorStyle": "line-thin",
"shellLauncher.shells.windows": [
{
"shell": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
"label": "PowerShell 5.1"
},
{
"shell": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
"label": "PowerShell 6.0"
},
{
"shell": "C:\\Windows\\System32\\cmd.exe",
"label": "cmd"
},
{
"shell": "C:\\Program Files\\Git\\bin\\bash.exe",
"label": "Git bash"
},
{
"shell": "C:\\Windows\\System32\\bash.exe",
"label": "WSL Bash"
},
VSCode is notorious for intellisense stopping for no apparent reason (it's my #1 grip with it), but in most cases, all you have to do is backspace to the beginning of your command and try again, or use the CRTL+Spacebar to have intellisense kick it, or type reload.
Again, this happens to me all the time, and the above brings things back. It's annoying, but it is what it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With