# VS Code 终端调用Power Shell 7 1. 安装Power Shell 7 ``` # 通过以下命令,可使用已发布的 winget 包安装 PowerShell: # 搜索最新版本的 PowerShell winget search Microsoft.PowerShell # Output Name Id Version Source ----------------------------------------------------------------- PowerShell Microsoft.PowerShell 7.4.1.0 winget PowerShell Preview Microsoft.PowerShell.Preview 7.4.0.101 winget # 使用 id 参数安装 PowerShell 或 PowerShell 预览版 winget install --id Microsoft.Powershell --source winget winget install --id Microsoft.Powershell.Preview --source winget ``` 2. 以管理员方式打开Power Shell 7,设置→启动,将默认配置文件设置为Power Shell 7。 ![1710737466638](image/powershell_1/1710737466638.png) 3. 打开VS Code,打开终端,默认配置文件为Power Shell即可。之后重新打开终端就已经替换为新安装的Power Shell。 ![1710737537686](image/powershell_1/1710737537686.png)