【问题标题】:Confused about why PowerShell Core has to be installed on Windows...?对为什么必须在 Windows 上安装 PowerShell Core 感到困惑……?
【发布时间】:2019-08-01 03:44:11
【问题描述】:

所以我刚刚阅读了关于 PowerShell 和 PowerShell Core 之间区别的冗长解释。基本上,后者是所有未来版本的 PowerShell 的新名称,它现在是开源和跨平台的。

好的。好的。但为什么它必须在 Windows 上安装?不是说它已经在 Windows 上,但你也可以在 Linux/macOS 上安装它,并像在 Windows 上一样使用它吗?

为什么即使在 Windows 上也是“安装”?那部分对我来说毫无意义。而且它不能用“它刚刚发布”来解释,因为它显然已经有好几年了......

【问题讨论】:

  • 因为 Windows PowerShellPowerShell Core 不同。
  • Windows PowerShell 是一个 Windows 组件。 PowerShell Core 是一个不同的产品
  • 正如我所提到的,不再有 PowerShell。所有未来的版本都称为 PowerShell Core。这就是我问这个问题的原因。这是我思考的前提。正如您在我的另一个问题中所做的那样,您回复的 cmets 似乎无视我在问题中输入的内容...
  • 他们仍然坚持在 Windows 中使用 PS 5,因为它有更多的命令,直到 PS 7。你可以安装两者。 PS 6 甚至是便携的。
  • 这可能会提供一些指示:devblogs.microsoft.com/powershell/…

标签: powershell powershell-core


【解决方案1】:

Powershell Core 是新的通用 Powershell。

Windows 附带“Windows Powershell”,它是 Powershell 核心的前身,仅在 Windows 上运行,并使用特定于 windows .net 的方法,而不是使用便携式.net 方法。

Powershell Core 正在积极开发和增强,可以在 Windows 和 Linux 系统上运行,但不包含 Windows 特定的方法,因为它旨在跨平台,这会导致一些不兼容。

Windows Powershell 5.1 功能最终将在未来的某个时间点(可能早在 7.0 版)最终并入 PowerShell 核心,而不是永久地继续构建和维护不同风格的 Powershell,并且不推荐使用的方法将需要重写以使用通用函数。

最后我读到这个 ​​Redmond 曾预测 Powershell Core 7.0 将基本上取代 Windows 上对 Powershell 5.1 的需求,并将在此后的某个时候开始成为 Windows 中 Powershell 的预装版本。 (所以可能是 Windows 2022 for Server 人员)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 2019-10-15
    相关资源
    最近更新 更多