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

[玩转系统] PowerShell 和 PowerShell Core 之间的区别

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

PowerShell 和 PowerShell Core 之间的区别


微软发布了PowerShell Core,这是PowerShell的新版本。新版本的 PowerShell 可在所有主要计算平台上使用,包括 Windows、Linux 和 MacOS。 Windows 开箱即用 PowerShell 5.1 和最新版本的 PowerShell Core v6.0

[玩转系统] PowerShell 和 PowerShell Core 之间的区别

PowerShell是 Microsoft 的一种命令行 shell 和脚本语言。它随 Windows 操作系统一起提供,并于 2006 年首次出现。

好吧,现在我们确实有两个公开可用的 PowerShell 版本。第一个是 PowerShell v5.1,第二个是较新的 PowerShell Core v6.0。

PowerShell 和 PowerShell Core 之间的区别

第一个也是最重要的区别是,我们知道 PowerShell Core 是跨平台的,可以在 Windows、Linux 和 MacOS 上运行,而旧版本仅在 Windows 上运行。

如果您好奇,您也可以在不受支持的 ARM 版本上运行 PowerShell Core,但这存在缺陷,预计会引发一些错误。

PowerShell Core 将提供新功能更新和修复,而旧版 PowerShell 将仅提供错误修复和安全更新。这是微软的官方声明:

不过,目前还没有计划向 Windows PowerShell 引入新功能。这意味着 Windows PowerShell 的回归风险非常低,因此您可以将其作为现有工作负载的稳定平台。

[玩转系统] PowerShell 和 PowerShell Core 之间的区别

其次,PowerShell Core 不如 Windows 自带的 PowerShell 强大。其背后的原因是,新的 PowerShell 使用功能不太丰富的 .NET Core 和 .NET Standard,而旧的 PowerShell 使用旧的 .NET Framework 和 .NET Standard。

这背后的原因是.NET Core是新的,微软需要时间让它像现在的.NET Framework一样强大。

微软表示,PowerShell 工作流程、PowerShell 管理单元、WMIv1 cmdlet 以及具体执行的所需状态配置资源。

现在,无需太多解释,让我以表格形式插入所有详细信息:

Attributes PowerShell PowerShell Core Versions 1.0 to 5.1 6 Platforms Supported Only Windows (Client + Server) Windows, Linux, and MacOS Dependency .NET Framework .NET Core Usage Depends on .NET Framework Runtime Depends on .NET Core Runtime Launched as powershell.exe pwsh.exe on Windows and pwsh on MacOS and Linux $PSVersionTable.PSEdition Set to Desktop Set to Core Future Updates for Bug fixes and Security Updates only Feature Update, Bug Fixes as well as Security Updates

现在,如果您想在 Windows、Linux 或 MacOS 计算机上试用 PowerShell Core,请访问同一此处的官方 GitHub 存储库页面,并找到适合您系统的版本。

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

取消回复欢迎 发表评论:

关灯