Using BEEP sound in PowerShell Scripts.

Using BEEP sound in PowerShell Scripts.

Hi,
After watching the valentine post of “Jeffery Hicks” I started playing with $([char]) characters. And while working with these characters I found a great character that is character 7.
23-02-2012 12-07-13
So what is interesting in character number 7?, it is a Beep Sound. For example if  in your script you are rebooting the server or laptop we can provide 3 beeps for rebooting. Or  we can  set a beep after every task or command finished his task.
Cool isn’t..
try this script.
Download Script from Here: http://dl.dropbox.com/u/17858935/Beep.zip
#### save it as beep.ps1 or so....
Write-Host "I am going to reboot the Laptop after 3 Beep" -ForegroundColor Red
$([char]7)
write-Host "Beep 1 " -ForegroundColor Green
sleep 1
$([char]7)
write-Host "Beep 2 " -ForegroundColor Green
sleep 1
$([char]7)
write-Host "Beep 3 " -ForegroundColor Green
sleep 1
Write-Host "`n"
Restart-Computer -Force -WhatIf
#################################
and the output is like below. Our computer is going to reboot after 3 beeps... 
23-02-2012 12-09-26 
Download Script from Here: http://dl.dropbox.com/u/17858935/Beep.zip 

Note: You can also ise `a to beep  and make sure that you enclosed it in double quotes like "`a" :)


Thanks for reading,
Aman Dhally
Leave a Comment
  • Please add 4 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (1 items)