Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect sound via PowerShell?

Tags:

powershell

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

like image 556
Mowgli Avatar asked Jun 14 '13 16:06

Mowgli


People also ask

Can PowerShell play sound?

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.

How do I download a PowerShell application?

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.


1 Answers

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

like image 176
OhadH Avatar answered Oct 02 '22 01:10

OhadH