系统极客一直在努力
专注操作系统及软件使用技能

PowerShell Core 6.0正式发布

PowerShell Core 6.0 是 PowerShell 的最新版本,它是适用于跨平台(Windows、MacOS 和 Linux)、开源、为异构环境和混合云而构建的版本。

FAQ

如果 Linux 中已经安装了旧版本,如何获得最新版本 PowerShell Core 6.0 ?

目前 powershell-6.0.0 将会被识别为比 powershell-6.0.0-rc2 版本低,微软正在解决这一 bug,所以可能用如下命令进行升级安装:

sudo apt remove powershell && sudo apt-get install powershell
sudo yum remove powershell && sudo yum install powershell

Windows PowerShell和PowerShell Core有什么区别?

Windows PowerShell 是在 .NET Framework 之上构建的 PowerShell 版本,也被微软被称为「FullCLR」:

  • Windows PowerShell 也是在过去 10 年中已被广泛使用的 Powershell。
  • 由于它依赖于 .NET Framework, 所以 Windows PowerShell 仅在 Windows 中可用。
  • Windows PowerShell 已经发布的版本包括 1.0、2.0、3.0、4.0、5.0 和 5.1。
  • Windows PowerShell 早已作为 Windows 客户端和 Windows Server 的内置组件提供。
  • Windows PowerShell 的可执行文件是 powershell.exe
  • 在 Windows PowerShell 5.0/5.1 中,$PSVersionTable.PSEdition 设置是 Desktop
  • 任何使用基于 .NET 的功能(例如 C#cmdlet、Add-Type 和静态 .NET 方法调用)都依赖于 .NET Framework 运行时,这就意味着 Windows PowerShell 的 .NET 使用仅限于 .NET Framework 和 .NET Standard 公开的功能。
  • 通过最新版本 Windows 和 Windows Server 的关键错误修复获得微软支持。

PowerShell Core 是在 .NET Core 之上构建的 PowerShell 版本,也被微软被称为「CoreCLR」:

  • 归功于 .NET Core 的跨平台特性,PowerShell Core 可在 Windows、macOS 和 Linux 系统中跨平台使用。
  • PowerShell Core 在 Windows 中的可执行文件是 pwsh.exe,在 macOS 和 Linux 中的启动文件是 pwsh
  • 在 PowerShell Core 中,$PSVersionTable.PSEdition 设置是 Core
  • 任何使用基于 .NET 的功能(例如 C#cmdlet、Add-Type 和静态 .NET 方法调用)都依赖于 .NET Core 运行时,这就意味着 PowerShell Core 仅限于 .NET Core 和 .NET Standard 公开的功能。

支持哪些平台

PowerShell Core 在以下平台上得到正式支持:

  • Windows 7、8.1 和 10
  • Windows Server 2008 R2、2012 R2、2016
  • Windows Server Semi-Annual Channel
  • Ubuntu 14.04、16.04 和 17.04
  • Debian 8.7+ 和 9
  • CentOS 7
  • Red Hat Enterprise Linux 7
  • OpenSUSE 42.2
  • Fedora 25, 26
  • macOS 10.12+

社区还为以下平台提供了软件包,但是并没有得到微软官方的支持:

  • Arch Linux
  • Kali Linux
  • AppImage(在多个 Linux 平台上运行)

以下平台还提供了实验性(不受支持的)版本:

  • Windows on ARM32/ARM64
  • Raspbian (Stretch)

PowerShell Core有哪些新特性

请查看 PowerShell Core 6.0 新增功能完整列表

赞(0) 赞赏

评论 抢沙发

微信赞赏