PowerShell 问题与修复
启用 PSReadLine 前缀搜索 让配置永久生效 在文件中加入: --- 永久设置 SSH 默认进入 PowerShell 7 Windows 管理员 PowerShell: MSI 安装版 wi…
启用 PSReadLine 前缀搜索
1Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
2Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
让配置永久生效
1notepad $PROFILE
在文件中加入:
1Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
2Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
永久设置 SSH 默认进入 PowerShell 7
Windows 管理员 PowerShell: MSI 安装版
1New-ItemProperty `
2 -Path HKLM:\SOFTWARE\OpenSSH `
3 -Name DefaultShell `
4 -Value "C:\Program Files\PowerShell\7\pwsh.exe" `
5 -PropertyType String `
6 -Force
winget MSIX 安装版
1New-ItemProperty `
2 -Path HKLM:\SOFTWARE\OpenSSH `
3 -Name DefaultShell `
4 -Value "$env:LOCALAPPDATA\Microsoft\WindowsApps\pwsh.exe" `
5 -PropertyType String `
6 -Force
然后:
1Restart-Service sshd