PSReadLine

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

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

  • PSReadLine 2.3.4 附带的 PowerShell 7.4.0
  • PowerShell 7.3.0 随附 PSReadLine 2.2.6
  • PowerShell 7.2.5 随附 PSReadLine 2.1.0
  • PowerShell 7.0.11 随附 PSReadLine 2.0.4
  • PowerShell 5.1 随附 PSReadLine 2.0.0

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

注意

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

PSReadLine

Get-PSReadLineKeyHandler

Gets the key bindings for the PSReadLine module.

Get-PSReadLineOption

Gets values for the options that can be configured.

PSConsoleHostReadLine

This function is the main entry point for PSReadLine.

Remove-PSReadLineKeyHandler

Removes a key binding.

Set-PSReadLineKeyHandler

Binds keys to user-defined or PSReadLine key handler functions.

Set-PSReadLineOption

Customizes the behavior of command line editing in PSReadLine.