Use CTRL + D to exit and CTRL + L to cls in Powershell console

前端 未结 6 1525
说谎
说谎 2021-02-01 13:13

I am trying to make

CTRL + D - exit Powershell console

and

CTRL + L - clear the screen

like in bash.

6条回答
  •  借酒劲吻你
    2021-02-01 13:50

    There is also a PowerShell snapin called PSEventing which will allow you to do this (see the demo on the front page:

    http://pseventing.codeplex.com/releases/view/66587

    # clear screen in response to ctrl+L, unix style 
    register-hotkeyevent "ctrl+L" -action { cls; write-host -nonewline (prompt) }
    

提交回复
热议问题