I want to detect if PC is playing any kind of sound.
if it isn't playing any kind of sound I can use else condition in Powershell and do whatever I need to do next.
So is there anyway to detect sound via PowerShell?
Thanks
Instead of twiddling your thumbs as you wait for a long-running script to complete, you can have PowerShell play a sound to alert you when it's done.
We are going to start with the most common way to download a file from an URL with PowerShell. For this, we will be using the Invoke-WebRequest cmdlet. To download a file we need to know the source URL and give up a destination for the file that we want to download. The parameter -OutFile is required.
method 1...
Import-Module -Name TroubleShootingPack
Get-TroubleshootingPack C:\Windows\diagnostics\system\Audio | Invoke-TroubleshootingPack
method 2... start to reverse engineer the scripts in C:\Windows\diagnostics\system\Audio :)
P.S: You can also read in shay's blog about how to do your specific task http://scriptolog.blogspot.co.il/2007/09/playing-sounds-in-powershell.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With