当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 在 Windows 上安装 PowerShell 7 的 5 种方法

作者:精品下载站 日期:2024-12-14 07:37:09 浏览:15 分类:玩电脑

在 Windows 上安装 PowerShell 7 的 5 种方法


PowerShell 7 是 PowerShell 5.1 的后续版本。它快速、可靠且跨平台。毫无疑问,PowerShell 7 是未来。您可以在 Windows、Linux 和 MacO 上安装 PowerShell 7。在这篇博文中,我向您展示了在 Windows 计算机上安装 PowerShell 7 的 5 种方法。

1. GitHub

GitHub 是一个开发者平台。只需搜索 PowerShell,您就会获得下载链接。

[玩转系统] 在 Windows 上安装 PowerShell 7 的 5 种方法

2. 微软文档 |微软学习

第二个选项是通过 Microsoft Docs。

[玩转系统] 在 Windows 上安装 PowerShell 7 的 5 种方法

3. Windows 11 上的 winget

也许最有吸引力和最酷的选择是不使用网络浏览器。只需在 Windows 11 上使用 winget。

winget search PowerShell --accept-source-agreements
winget install Microsoft.PowerShell --accept-source-agreements --accept-package-agreements

4. 开始位传输

Start-BitsTranser 是一个可用于下载文件的 cmdlet。它使用后台智能传输服务来管理下载。以下代码下载 PowerShell 7(注意 PowerShell 版本!)并安装它。

Start-BitsTransfer `
-Source https://github.com/PowerShell/PowerShell/releases/download/v7.2.5/PowerShell-7.2.5-win-x64.msi `
-Destination (Join-Path -Path $home -ChildPath Downloads)

MsiExec.exe /i (Join-Path -Path $home -ChildPath Downloads\PowerShell-7.2.5-win-x64.msi) /qn

5.PSReleaseTools模块

最后但并非最不重要的一点是,只需使用发布工具模块。按按键并输入以下行来安装 PowerShell 7。

Install-Module PSReleaseTools 
Install-PSPreview

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯