使用Winget命令:
Winget 是 Windows 10 中引入的命令行包管理器,它允许您从集中存储库下载并安装软件包。要使用 Winget 命令行工具安装或更新 PowerShell Core 7,请按照以下步骤操作:
使用管理权限打开 PowerShell 窗口。
要搜索可用的 PowerShell 版本,请运行以下命令:winget search Microsoft.Powershell
要安装所需的 PowerShell Core 版本,请使用以下命令:winget install --id Microsoft.PowerShell
这将下载并安装最新的稳定 PowerShell Core 版本。