[英]Visual Studio Code fails to open from Powershell
I'm trying to open Visual Studio Code from Powershell using the code
command while inside a folder.我正在尝试在文件夹内使用
code
命令从 Powershell 打开 Visual Studio Code。 When I try to do this, I always get this error:当我尝试这样做时,我总是收到此错误:
Blockquote code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program.
块引用代码:术语“代码”不是 cmdlet、函数、脚本文件或可运行程序的名称。 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 .
在 line:1 char:1 + code 。 + ~~~~ + CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
+ ~~~~ + CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException +fullyQualifiedErrorId : CommandNotFoundException
When you install Visual Studio Code, there is a checkbox in the installer labeled:安装 Visual Studio Code 时,安装程序中有一个复选框,标记为:
Add to PATH (requires shell restart)
添加到 PATH(需要重新启动 shell)
Make sure this is checked, and that you restart any active shell instances after installation is completed.确保选中此项,并在安装完成后重新启动所有活动的 shell 实例。
I found a closed GitHub issue ( https://github.com/Microsoft/vscode/issues/22881 ) with the exact same problem and the solution for the person who asked for a solution was:我发现了一个封闭的 GitHub 问题 ( https://github.com/Microsoft/vscode/issues/22881 ) 与完全相同的问题,寻求解决方案的人的解决方案是:
Go to File > Preferences > Settings
Change the property "terminal.integrated.shell.windows" as follows:
"terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe"
Restart visual studio.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.