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

[玩转系统] 如何在 Windows 上安装 PowerShell 7

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

如何在 Windows 上安装 PowerShell 7


PowerShell 是一种开源程序,可使用命令和脚本语言自动执行任务和流程。在某些情况下,您需要更新到 PowerShell 7。不过,这一切都是免费的,您可以通过三种不同的方式来完成此操作。本文向您展示了在 Windows 上安装最新 PowerShell 7 的三种方法。

如何下载并安装 PowerShell 7

在 Windows 上下载和安装 PowerShell 7 可以使用三种不同的选项。让我们看看所有这些选项,您可以决定哪个最适合您。

选项 1. 在 Microsoft Store 中获取 PowerShell 7 应用程序

在 Windows 10 上安装 PowerShell 7 最简单的方法是从 Microsoft Store 获取该应用程序。

  1. 打开 Microsoft Store 应用
  2. 输入 PowerShell 并搜索
  3. 点击获取

它将在您的 Windows 上下载 PowerShell 7 应用程序,并且可以使用。

[玩转系统] 如何在 Windows 上安装 PowerShell 7

另一种选择是通过转到 Microsoft Store 主页并单击获取商店应用来下载 PowerShell 应用。

[玩转系统] 如何在 Windows 上安装 PowerShell 7

就是这样!您已成功将 PowerShell 应用程序下载到您的 PC 上,并且可以开始使用它。

选项 2. 使用 Winget 下载并安装 PowerShell 7

建议使用 Winget 下载并安装最新版本的 PowerShell 7。Winget 是 Windows 11 和 Windows 10 版本 1709 或更高版本支持的命令行工具。使用此工具,您可以在 Windows 上下载、安装或升级应用程序。

  1. 以管理员身份打开 PowerShell 并运行以下命令
winget install Microsoft.PowerShell
  1. 它将下载并安装最新版本的 PowerShell 7
  2. 等待 Windows 配置 PowerShell 7

输出将如下所示。

PS C:\> winget install Microsoft.PowerShell
Found PowerShell [Microsoft.PowerShell] Version 7.3.1.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/PowerShell-7.3.1-win-x64.msi
  ██████████████████████████████   101 MB /  101 MB
Successfully verified installer hash
Starting package install...
Successfully installed

您已成功安装 PowerShell 7,并且可以使用它了。

如果您的 Windows 不支持 Winget 命令行,请使用下一个选项。

选项 3.下载 MSI 包以在 Windows 上安装 PowerShell 7

另一种方法是从 Microsoft 下载 MSI 包。

有两种不同的套餐:

  • PowerShell-7.3.2-win-x64.msi
  • PowerShell-7.3.2-win-x86.msi

在我们的示例中,我们确实下载了 PowerShell x64 包。

请按照以下步骤进行安装:

  1. 双击安装PowerShell-7.3.2-win-x64.msi
  2. 单击运行
  3. 点击下一步

[玩转系统] 如何在 Windows 上安装 PowerShell 7

  1. 保持默认选项,点击下一步三次
  2. 点击安装

[玩转系统] 如何在 Windows 上安装 PowerShell 7

  1. 点击完成

[玩转系统] 如何在 Windows 上安装 PowerShell 7

此选项与使用 Winget 命令行相同,如上一步所示。不同之处在于,您需要下载 PowerShell 7 安装程序并执行安装向导,而不是以前的方法,后者会自动为您完成此操作。

运行 PowerShell 7

要在 Windows 上运行 PowerShell 7,请按照以下步骤操作:

  1. 单击开始
  2. 搜索PowerShell 7
  3. 选择以管理员身份运行

[玩转系统] 如何在 Windows 上安装 PowerShell 7

这是否有助于您在 Windows 上安装 PowerShell 7?让我们知道您选择哪个选项!

了解更多:安装 Exchange Online PowerShell 模块 »

结论

您了解了如何通过三种不同的方式在 Windows 上下载和安装 PowerShell 7。最快的方法是从 Microsoft Store 下载 PowerShell 应用程序或使用 PowerShell 中的 Winget 命令行工具。另一种方法是下载安装程序并在 Windows 上安装 PowerShell 7,但需要更长的时间,因为您必须完成安装向导。

您喜欢这篇文章吗?您可能还喜欢使用 PowerShell 批量创建共享邮箱。不要忘记关注我们并分享这篇文章。

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

取消回复欢迎 发表评论:

关灯