Tuesday, August 7, 2012

Powershell Tricks : Use Windows System Sounds in your Powershell Scripts

PowerHi,

In my script i love to add notifications normally i use default beep sound. Few of my script which runs in background while i am working on something else i want to add few more sound notification in to them, So if any error occurred i get aware of them.

I found that windows Dot Net Library have few more extra sound notifications. That library get the notifications sounds those are configured in “Sounds” option in the Control Panel.

Like the Asterisk, Beep sound.

07-08-2012 18-35-32

If you want to add sound notifications in to your scripts, you can use any of the below command listed below in to you script.

[System.Media.SystemSounds]::Asterisk.play()

[System.Media.SystemSounds]::Beep.play()

[System.Media.SystemSounds]::Exclamation.play()

[System.Media.SystemSounds]::Hand.play()

[System.Media.SystemSounds]::Question.play()

try them in your POSH console , you will love then Winking smile 

07-08-2012 18-36-19

Thanks for reading.

Thanks!

Aman Dhally


Buy-More-Twitter-Followers 4fb29548b6adc linkedin

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.