【问题标题】:Why does PowerShell 5 from Windows 7 not have the same features as Windows 10?为什么 Windows 7 中的 PowerShell 5 没有与 Windows 10 相同的功能?
【发布时间】:2016-06-20 04:11:08
【问题描述】:

我在 Windows 7 SP1 机器上将我的 PowerShell 从 4.0 升级到 5.0(2016 年 2 月版)。

$PSVersionTable 显示 PowerShell 5.0,但该 shell 的功能与 Windows 10 中的 PowerShell 5.0 不同。

区别:

  • 关键字突出显示
  • 使用 Shift+箭头键选择文本
  • 使用 Ctrl+C/V 复制/粘贴

为什么会有差异?

如何获取/启用这些缺失的功能?

【问题讨论】:

  • 安装/导入 PSReadLine 以获得您在 Win10 中看到的可视化编辑功能(其中默认包含 PSReadLine)
  • 弗罗德的回答比较完整

标签: powershell windows-console powershell-5.0 psreadline


【解决方案1】:

某些功能来自预装在 Win10 中的PSReadLine-模块。您可以从 github 手动安装,也可以运行:

Install-Module PSReadLine

某些功能来自 Windows 10 对控制台主机 conhost.exe 的增强,默认情况下用于 powershell 和 cmd。 conhost.exe是 Windows 本身的一部分,而不是 Powershell 所属的 Windows 管理框架。

【讨论】:

    猜你喜欢
    • 2020-05-16
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多