PowerShell Pause

Posted by Isaac Blum at 31 December 2009

Category: Business, For The Greater Good, Free Help, PowerShell

Tags: ,

Add the below code to any PowerShell script to call a pause.

This code is made possible by http://blogs.msdn.com/powershell/archive/2007/02/25/pause.aspx

1
2
3
4
5
6
function Pause ($Message="Press any key to continue...")
{
Write-Host -NoNewLine $Message
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host ""
}
  • Share/Bookmark

Leave a Reply

Leave a Reply
  • (required)
  • (required) (will not be published)

  • Archives

  • Pages

  • Tags

  • More

Get Adobe Flash playerPlugin by wpburn.com wordpress themes