为什么 Visual Studio 代码使用 5.1 而不是 Core 在单独的 shell 中打开我的 PowerShell 文件?
Why does Visual Studio Code open my PowerShell files in a separate shell using 5.1 instead of Core?
我在 settings.json 文件中设置了 "terminal.integrated.shell.windows": "C:\Program Files (x86)\PowerShell\6\pwsh.exe"
,当我打开没有任何文件的 VS 代码时,终端设置为 pwsh,但是当我打开 PowerShell 脚本时,突然出现第二个终端(PowerShell 集成控制台)和 运行 调试器导致使用 PowerShell 5.1 而不是 6(核心)。
我需要做什么才能在打开 .ps1 文档时使用 PowerShell 版本 6? 运行 它在命令行中有效,但是很痛苦。
PowerShell 集成控制台是 PowerShell 扩展用来处理 .ps1 文件的工具,由不同的设置 (powershell.powerShellExePath) 控制。
您可以通过打开 .ps1 文件轻松更改此设置,然后单击状态栏右下角的“5.1”、“6.0”等图标。这将打开 PowerShell 会话菜单,您可以在其中 select 您希望扩展程序使用哪个版本的 PowerShell(在您已安装的版本中)。
您的选择将保留在 powershell.powerShellExePath 下的用户设置中。
我在 settings.json 文件中设置了 "terminal.integrated.shell.windows": "C:\Program Files (x86)\PowerShell\6\pwsh.exe"
,当我打开没有任何文件的 VS 代码时,终端设置为 pwsh,但是当我打开 PowerShell 脚本时,突然出现第二个终端(PowerShell 集成控制台)和 运行 调试器导致使用 PowerShell 5.1 而不是 6(核心)。
我需要做什么才能在打开 .ps1 文档时使用 PowerShell 版本 6? 运行 它在命令行中有效,但是很痛苦。
PowerShell 集成控制台是 PowerShell 扩展用来处理 .ps1 文件的工具,由不同的设置 (powershell.powerShellExePath) 控制。
您可以通过打开 .ps1 文件轻松更改此设置,然后单击状态栏右下角的“5.1”、“6.0”等图标。这将打开 PowerShell 会话菜单,您可以在其中 select 您希望扩展程序使用哪个版本的 PowerShell(在您已安装的版本中)。
您的选择将保留在 powershell.powerShellExePath 下的用户设置中。