PSReadLine Module
PSReadLine 模組包含 Cmdlet,可讓您在 PowerShell 中自定義命令行編輯環境。
自 Windows PowerShell 5.1 隨附的版本以來,PSReadLine 有許多更新。
- v2.3.6 首次在 PowerShell 7.4.7 和 7.5.0 中提供
- 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.6 版。
備註
從 PowerShell 7.0 開始,如果偵測到螢幕助讀程式程式,PowerShell 會略過 Windows 上的自動載入 PSReadLine。 目前,PSReadLine 不適用於螢幕助讀程式。 Windows 上 PowerShell 7.0 的預設轉譯和格式設定可正常運作。 您可以視需要手動載入模組。
PSReadLine Cmdlet
| 指令程式 | Description |
|---|---|
| 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. |