Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Wait for a Key Press

$
0
0

Summary: Learn about the Windows PowerShell version of “Pause.”

Hey, Scripting Guy! Question How can I use Windows PowerShell to wait for a key in scripts like I used to use “Pause” in the command console?

Hey, Scripting Guy! Answer Use the $Host variable in the console:

$HOST.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | OUT-NULL
$HOST.UI.RawUI.Flushinputbuffer()


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>