This code waits for a keyboard press. It passes back the character that is pressed, and you can then enact scripts based on the key pressed.
Script follows below:
Write-Host "Press the c key to continue to create a contact with the above variables"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
#Exit if the "c" character is not pressed.
if ($x.Character -ne "c")
{
write-Host $x.Character
exit
}
#Continue with rest of code
Friday, June 11, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment