December 26th, 2013

PowerTip: Display a Blinking Message by Using PowerShell

Doctor Scripto
Scripter

Summary: Use this one-line Windows PowerShell command to display a blinking message.

Hey, Scripting Guy! Question Is there a one-line command that I could use to blink a message in the Windows PowerShell console to get the users attention?

Hey, Scripting Guy! Answer Pipe a range of numbers to the Foreach-Object cmdlet (% is an alias), clear the screen in the Begin block,
          and then display the message, pause, clear the screen, and pause in the Process block:

1..3 | % -begin {cls} -process {“hello”;sleep 1;cls;sleep 1}

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.