安装PSReadLine
超级管理员下
Install-Module -Name PSReadLine -RequiredVersion 2.3.5
具体最新版本:https://www.powershellgallery.com/packages/PSReadLine/
编辑powersheel配置文件
在~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
如果没有则创建
内容如下:
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
# 下面两种选一种
#Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -PredictionViewStyle InlineView
Set-PSReadLineOption -EditMode Emacs