PowerTip: Display a Blinking Message by Using PowerShell

PowerTip: Display a Blinking Message by Using PowerShell

  • Comments 9
  • Likes

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}

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • so much cool stuff its amazing seriously

  • Ultimate.

  • What if want the rest of the screen to stay intact, but we only want a specific line in the window to blink (let's say it's the last line) - is there a way to do this? Thanks!