字号·· | 护眼
theregister

PowerShell 7将随Windows捆绑发布,5.1走向终点PowerShell 7 heading into Windows as 5.1 hits the end of the road

点「原文对照」整页切到原文,或双击某段只看那段的原文。

微软已确认,PowerShell 7 终将随 Windows 一同提供,而历史悠久的 PowerShell 5.1 则开始其漫长的退役进程。这一变化酝酿已久,不过 PowerShell 5.1 并不会立即消失。但它“将从未来某个版本的 Windows 中移除”,而 Windows Server 2025 和 Windows 11 26H2 是最后两个默认启用 PowerShell 5.1 的版本。

Microsoft has confirmed that, at long last, PowerShell 7 will come bundled with Windows, while the venerable PowerShell 5.1 begins its long retirement. It has been a long time coming, although PowerShell 5.1 isn't going away immediately. It will, however, "be removed from a future version of Windows," and Windows Server 2025 and Windows 11 26H2 are the last versions to include PowerShell 5.1 enabled by default.

此后,PowerShell 5.1 将作为按需功能(FOD)提供,最终彻底退出历史舞台,由 PowerShell 7 接管自动化任务。PowerShell 5.1 如今已有十多年历史,运行在 .NET Framework 上。PowerShell 7 是其跨平台、开源的继任者,但兼容性并非无缝衔接。PowerShell 是杰弗里·斯诺弗的心血结晶,他在图形用户界面盛行的时代,力图将脚本自动化引入 Windows。

After that, PowerShell 5.1 will be available as a Feature On Demand (FOD) before eventually shuffling off into the sunset, while PowerShell 7 takes over automation duties. PowerShell 5.1 is now more than ten years old and runs on the .NET Framework. PowerShell 7 is its cross-platform, open source successor, but compatibility isn't seamless. PowerShell was the brainchild of Jeffrey Snover, who sought to bring script automation to Windows at a time when graphical user interfaces were king.

他回忆说,高管们曾告诉他“管理员不想要命令行界面”,以及“Windows 到底他妈的哪一部分让你困惑?”,但他最终赢得了这场争论,我们估计无数 Windows 管理员都欠他一份感激。多年来,PowerShell 5.1 几乎没有增加什么新功能。微软 PowerShell 团队高级产品经理杰森·赫尔米克写道:“PowerShell 7 是现代版的 PowerShell:我们公开开发、跨平台,新功能都会加入其中。”

He recalled executives telling him "admins don't want command line interfaces," and "exactly what part of effing Windows is confusing you?" but eventually won the argument, and we reckon countless Windows administrators owe him a debt of gratitude. PowerShell 5.1 hasn't had many new features for years. "PowerShell 7 is the modern PowerShell: the one we develop in the open, across platforms, and where new features go," wrote Jason Helmick, a senior product manager on Microsoft's PowerShell team.

但兼容性方面的琐碎问题依然存在。两者可以并行运行,因此现有脚本不必立即迁移。然而,要在整个企业环境中找到并测试所有分散的脚本,可能会让管理员忙上一阵子。微软在捆绑版本的 MSIX 打包方面还有未完成的工作,包括支持以 SYSTEM 身份运行、DISM cmdlet 以及全机设置。这些缺口对计划任务、服务和管理脚本来说至关重要。

But compatibility niggles remain. The two can run side by side, so existing scripts won't have to move immediately. Finding and testing everything scattered across an enterprise estate, however, could keep administrators occupied for some time. Microsoft also has unfinished work on the bundled version's MSIX packaging, including support for running as SYSTEM, DISM cmdlets, and machine-wide settings. Those gaps matter for scheduled tasks, services, and management scripts.

尽管已被弃用,PowerShell 5.1 仍将根据其运行所在 Windows 版本的生命周期继续接收更新。微软表示,最终将根据使用数据移除该版本,并会“提前通知”。管理员有时间做准备,但检查哪些脚本可原样运行、哪些需要修改、哪些仍依赖 5.1 版本,这不会自动完成。“将 PowerShell 7 纳入 Windows 是我们自 PowerShell 跨平台以来一直在努力实现的里程碑,”Helmick 写道,不过捆绑发布仍在后面。

Despite the deprecation, PowerShell 5.1 will continue to receive updates based on the lifecycle of the Windows version on which it runs. It will eventually be removed based on usage data and "communicated in advance," according to Microsoft. Administrators have time to prepare, but checking which scripts run unchanged, which need work, and which still depend on 5.1 won't happen by itself. "Including PowerShell 7 in Windows is a milestone we've been working toward since PowerShell went cross-platform," Helmick wrote, although the bundled release is still ahead.

微软表示 PowerShell 7 将随下一个 Windows 版本推出,但尚未透露名称。会是 27H2 吗?®

Microsoft says PowerShell 7 will arrive with the next Windows release, but hasn't named it. 27H2, anyone? ®

阅读媒体原文 ↗