windows 下升级 powershell
发布于
·刚刚更新🔥 热乎乎
Windows 自带 Powershell,但是你运行默认的终端的时候会提醒你升级 Powershell,本文主要介绍如何升级.
安装
使用 WinGet 进行安装
查找最新版本的 PowerShell
powershell
winget search Microsoft.PowerShell
输出如下
powershell
Name Id Version Source
---------------------------------------------------------------
PowerShell Microsoft.PowerShell 7.5.2.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.6.0.4 winget
然后使用下面命令即可安装
powershell
winget install --id Microsoft.PowerShell --source winget`
运行
在终端中,默认运行的还是 5.1 . 需要运行 7.x 版本,需要你做一下调整.
在 Windows Terminal 中配置 默认配置文件为 PowerShell 7 即可.
如下图

参考链接:
https://learn.microsoft.com/zh-cn/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#install-powershell-using-winget-recommended