GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Windows/System32/WindowsPowerShell/v1.0/en-US/ |
Upload File : |
ABOUT_PSCONSOLEHOSTREADLINE SHORT DESCRIPTION Explains how to create a customize how PowerShell reads input at the console prompt. LONG DESCRIPTION Starting in Windows PowerShell V3, you can write a function named PSConsoleHostReadLine that overrides the default way that console input is processed. EXAMPLES The following example launches Notepad and gets input from a text File that the user creates: function PSConsoleHostReadLine { $inputFile = Join-Path $env:TEMP PSConsoleHostReadLine Set-Content $inputFile "PS > " # Notepad opens. Enter your command in it, save the file, and then exit. notepad $inputFile | Out-Null $userInput = Get-Content $inputFile $resultingCommand = $userInput.Replace("PS >", "") $resultingCommand } REMARKS By default, PowerShell reads input from the console in what is known as "Cooked Mode" -- in which the Windows console subsystem handles all the keypresses, F7 menus, and other input. When you press Enter or Tab, Windows PowerShell gets the text that you have typed up to that point. There is no way for it to know that you pressed Ctrl-R, Ctrl-A, Ctrl-E, or any other keys before pressing Enter or Tab. In Windows PowerShell version 3, the PSConsoleHostReadLine function solves this issue. When you define a function named PSConsoleHostReadline in the Windows PowerShell console host, Windows PowerShell calls that function instead of the "Cooked Mode" input mechanism. SEE ALSO about_Prompts