This works for both the PowerShell commandline console as well as in the PowerShell ISE. Solution 2: Works in PowerShell ISE Here is a simple way to pause the script execution and wait for the user to press the ENTER key to continue. Read -p 'Press enter to continue' As mentioned in the comments above, this command does actually require the user to press enter a solution that works with any key would be: read -n 1 -s -r -p 'Press any key to continue' Explanation by Rayne and wchargin-n defines the required character count to stop reading-s hides the user's input. Not exactly the correct behavior if you want to have 'Press any key to continue'. ![]() According to Microsoft's documentation, read-host lets the user type some input, and then press enter to continue. How do you do a ‘Pause' with PowerShell 2.0? (5 answers) Closed 4 years ago.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |