Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Learn how to wait for user to press a key in PowerShell.
October 30, 2016
Q. How can I pause a PowerShell script until a user presses a key?
A. The two lines of PowerShell below will pause a script until the user presses (and does not have to release) a key.
Write-Host "Press any key to continue ....."$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
You May Also Like