我刚刚开始使用Visual Studio代码来处理Powershell。我已经加载了powershell扩展,当我连接到Exchange时,cmdlet的自动完成功能在集成的powershell窗口中有效,但在to peditor面板中不起作用。如何让cmdlet自动完成或intellisense在编辑器面板中工作?谢谢!
发布于 2019-05-23 03:20:35
您没有说明是否已将VSCode环境配置为将PowerShell作为默认语言。如果您查看编辑器的右上角,它将告诉您当前设置为哪种语言。显示您的用户设置。在您的用户设置中,您应该有这样的代码行(只是我的一个示例,根据您的用例进行调整-有关VSCode用户设置的详细信息,请参阅文档。)…
"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因智能感知无故停止而臭名昭著(这是我对它的第一把戏),但在大多数情况下,你所要做的就是退格到命令开头再试一次,或者使用CRTL+Spacebar让智能感知踢它,或者输入reload。
同样,这种情况总是发生在我身上,上面的事情让我想起了一些事情。这很烦人,但事实就是如此。
https://stackoverflow.com/questions/56260070
复制相似问题