【发布时间】:2022-11-09 00:30:55
【问题描述】:
请注意,在我的新终端 VS Code 中,第一行表明它已正确默认为 Powershell 7.2.2 - 正如我认为应该的那样。
但是在同一个屏幕截图中,我运行的第一个脚本(它有一个打印出 powershell 版本的命令)它显示 PSVersion 是 5.1.19041.1320
这是我来自settings.json 的所有特定于 Powershell 的 VSCode 条目
"terminal.integrated.profiles.windows": {
"MyPowerShell_7": {
"path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"args": ["-NoProfile"]
}
},
"terminal.integrated.defaultProfile.windows": "MyPowerShell_7",
"powershell.powerShellAdditionalExePaths": [
{
"exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"versionName": "MyPowerShell_7"
}
],
"powershell.powerShellDefaultVersion": "MyPowerShell_7",
为什么运行Test-Json cmdlet 这么难?
【问题讨论】:
标签: visual-studio-code powershell-7.0 powershell-7.2