23 lines
825 B
PowerShell
23 lines
825 B
PowerShell
|
|
# 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."
|