PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

image rotation

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.


As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Waiting for a Keystroke

All PowerShell versions, PowerShell Console only

To keep the PowerShell console open when a script is done, you may want to add a “Press Any Key” statement. Here is a way how you can implement this:

Write-Host 'Press Any Key!' -NoNewline
$null = [Console]::ReadKey('?') 

This will work in a real PowerShell console only. It will not work in the ISE editor or any other PowerShell editor that does not use a real console with a real interactive keyboard buffer.

Twitter This Tip! ReTweet this Tip!

Copyright 2012 PowerShell.com. All rights reserved.