PowerShell / Visual Studio Code:更新Visual Studio Code中的PowerShell版本

4
我正在使用Visual Studio Code v1.37.1,它使用的是PowerShell v5.1.18362.145。我去GitHub获取并安装了最新的PowerShell(v6.2.2),但是,在VS Code中运行$psversiontable命令时,它告诉我仍在使用旧版本。
我该如何让VS Code使用我已安装的最新PowerShell版本?
谢谢。 PowerShell管理窗口: enter image description here

VSCode文档中提到:“对于Windows,终端下拉菜单中有一个方便的shell选择器,可以让您在几个检测到的shell之间进行选择,包括命令提示符、PowerShell和PowerShell Core。”但对我来说并不是这样,尽管它已经在我的路径中了。 - dudeNumber4
3个回答


0

在最新的VS Code中,只需转到设置并进行配置:

terminal.integrated.profiles

只需要将其设置为PowerShell而不是默认值(或适当的目录)。


0

code --install-extension PowerShell-6.2.2.vsix


谢谢@JohnMeek,感谢您的回复。我收到了一个“没有这个文件或目录”的错误。 - JM1
不起作用,没有澄清。 - Sean Kendle

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接