PowerShell 輸入命令時聯想曆史記錄,啟用 PSReadLine 模塊的預測性補全
配置 PowerShell 模塊倉庫的信任策略
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
取消 PowerShell 模塊倉庫的信任策略
Set-PSRepository -Name PSGallery -InstallationPolicy Untrusted
查看安裝的 PSReadLine 版本
Get-Module -Name PSReadLine -ListAvailable
安裝 PSReadLine
Install-Module -Name PSReadLine -Force -AllowClobber
卸載 PSReadLine
Uninstall-Module -Name PSReadLine -Force
卸載 PSReadLine,占用問題,可以用 cmd 卸載
powershell Uninstall-Module -Name PSReadLine -Force
啟用預測性補全(基於曆史記錄)
Set-PSReadLineOption -PredictionSource History
設置預測補全顯示方式(InlineView 為行內顯示)
Set-PSReadLineOption -PredictionViewStyle InlineView
關閉所有 PowerShell 窗口後,執行以下命令刪除曆史文件
Remove-Item (Get-PSReadLineOption).HistorySavePath -Force
版權屬於:zgcwkj
本文鏈接:https://www.zgcwkj.com/archives/260.html
轉載聲明:請注明本文章的標題及內容的出處和聲明,謝謝
評論已關閉