I needed a "pause" command for some of my PowerShell scripts, so this is what I ended up with. Enjoy.
param( [string]$message = "Press any key to continue..." ) Write-Host -NoNewLine $Message $Host.UI.RawUI.FlushInputBuffer() do { $key = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown").Character } while ([int]$key -eq 0) Write-Host ""