update
This commit is contained in:
22
powershellScripts/setup_psreadline.ps1
Normal file
22
powershellScripts/setup_psreadline.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
# Install the PSReadLine module
|
||||
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
|
||||
|
||||
# Check if the profile exists and create it if not
|
||||
if (!(Test-Path -Path $PROFILE)) {
|
||||
New-Item -Type File -Path $PROFILE -Force
|
||||
}
|
||||
|
||||
# Add PSReadLine configuration to the PowerShell profile
|
||||
Add-Content -Path $PROFILE -Value '
|
||||
Import-Module PSReadLine
|
||||
Set-PSReadLineOption -EditMode Emacs
|
||||
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
|
||||
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
|
||||
Set-PSReadLineOption -ShowToolTips
|
||||
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
|
||||
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
|
||||
'
|
||||
|
||||
# Output the content to check
|
||||
Write-Output "PSReadLine module installation and profile configuration script created."
|
||||
Reference in New Issue
Block a user