PSReadLine

PSReadLine 模块包含允许自定义 PowerShell 中的命令行编辑环境的 cmdlet。

自 Windows PowerShell 5.1 中随附的版本以来,PSReadLine 已经进行了多次更新。

  • v2.3.5 首先在 PowerShell 7.4.2 和 7.5.0-preview.3 中发布
  • v2.3.4 首次在 PowerShell 7.4.0-rc.1 中发布
  • v2.2.6 首次在 PowerShell 7.3.0 中发布
  • v2.1.0 首先在 PowerShell 7.2.5 中发布
  • v2.0.4 首次在 PowerShell 7.0.11 中发布
  • v2.0.0 随附在 Windows PowerShell 5.1 中

有关版本差异的详细信息,请参阅 about_PSReadLine_Release_Notes

这些文章介绍了 PSReadLine 版本 2.3.5。

注意

从 PowerShell 7.0 开始,如果检测到屏幕阅读器程序,PowerShell 将跳过在 Windows 上自动加载 PSReadLine。 目前,PSReadLine 不适用于屏幕阅读器。 PowerShell 7.0 在 Windows 上的默认呈现和格式设置正常工作。 必要时,可以手动加载模块。

PSReadLine

Get-PSReadLineKeyHandler

获取 PSReadLine 模块的键绑定。

Get-PSReadLineOption

获取可配置的选项的值。

PSConsoleHostReadLine

此函数是 PSReadLine 的主要入口点。

Remove-PSReadLineKeyHandler

移除键绑定。

Set-PSReadLineKeyHandler

将键绑定到用户定义的键处理程序函数或 PSReadLine 键处理程序函数。

Set-PSReadLineOption

自定义 PSReadLine中命令行编辑的行为。