How to configure system volume with PowerShell

Back in 2011 I wrote a blog post on how to mute Windows System Volume programmatically.  This week I found another approach on GitHub using PowerShell.

The PowerShell Module WindowsAudioDevice-Powershell-Cmdlet provides a number of cmdlets to control the Windows System volume.

  • Get-DefaultAudioDevice
  • Get-AudioDeviceList
  • Set-DefaultAudioDevice [-Index] <Int>
  • Set-DefaultAudioDevice [-Name] <String>
  • Set-DefaultAudioDevice [-InputObject] <AudioDevice>
  • Set-DefaultAudioDeviceVolume -Volume <float>
  • Get-DefaultAudioDeviceVolume
  • Set-DefaultAudioDeviceMute
  • Write-DefaultAudioDeviceValue [-StreamValue

I wrote the below PowerShell script to solve a request to set the system volume to mute.

SetPCVolumeMute.ps1

If you do not want to permanently install the module on the device, just place the following files into the same directory as the SetPCVolumeMute.ps1

“\PCVolumeMute\AudioDeviceCmdlets.dll”
“\PCVolumeMute\AudioDeviceCmdlets.dll-Help.xml”
“\PCVolumeMute\CoreAudioApi.dll”
“\PCVolumeMute\SetPCVolumeMute.ps1”

I have tested the script on Windows 8 64 bit and Windows 7 64 Bit and on 3 different hardware models.

That’s it

Leave a Reply

Your email address will not be published. Required fields are marked *