Search This Blog

Wednesday, 1 July 2015

powershell help

How to play beep and other system sounds in powershell script ?

Below piece of code can be used to play a beep from a Powershell script. I have used in many of scripts where user interaction is required. Presenting a list of different sounds which can be played from a Powershell script.

Beep:
  1. #--Statement to play beep from Powershell Scripts --#    
  2. clear   
  3. [System.Media.SystemSounds]::Beep.Play()   
Hand:
  1. #--Statement to play hand from Powershell Scripts --#    
  2. clear   
  3. [System.Media.SystemSounds]::Hand.Play()   
Asterisk:
  1. #--Statement to play Asterisk from Powershell Scripts --#    
  2. clear   
  3. [System.Media.SystemSounds]::Asterisk.Play()   
Exclamation:
  1. #--Statement to play Exclamation from Powershell Scripts --#    
  2. clear   
  3. [System.Media.SystemSounds]::Exclamation.Play() 

    for more follow me on twiiter : parmgosal001 
    1.                                      facebook : parmindergosal@gmail.com

1 comment:

Unknown said...

good one
if it is helpfull then please subscribe and for more help you can contact me by above informatin