I am trying to make
CTRL + D - exit Powershell console
and
CTRL + L - clear the screen
like in bash.
If you don't mind relying on an external program, you could do the following with AutoHotKey:
#IfWinActive ahk_class ConsoleWindowClass
^L::SendInput , {Esc}cls{Enter}
^D::SendInput , {Esc}exit{Enter}
#IfWinActive
The above will work with the PowerShell or CMD console. Otherwise the only thing I can think of would be to work up some P/Invoke magic with SetWindowsHookEx
.
Edit: Fixed AutoHotkey script to pass through the shortcut keys to other programs.