Powershell: How to iterate and set Sound Playback and Sound Input device?

Well, one of the things that is worse in Win11 is that it is now several clicks to change audio playback device (where in Win10 it was two or three clicks).

Time to script it.

What is the method in powershell to:

Upvotes: 2

Views: 5397

Answers (1)

Vasil Nikolov
Vasil Nikolov

Reputation: 757

I am not sure if its gonna work on Windows 11 but its worth a try.

There is a module in powershell that can be used to manage sound devices and volume level. Try AudioDeviceCmdlets module from the PSGallery https://www.powershellgallery.com/packages/AudioDeviceCmdlets/3.0.0.4

Then you can use Get-AudioDevice -List to see the available audio devices, and Set-AudioDevice <AudioDevice> -index 1 to set the desired "AudioDevice" to be the default input/output.

More on the module here - https://github.com/frgnca/AudioDeviceCmdlets

Upvotes: 4

Related Questions