PowerShell DSC Resource to control audio volume.
You can install Resource through PowerShell Gallery.
Install-Module -Name AudioVolumeDsc- AudioVolume PowerShell DSC Resource to control audio volume.
-
[string] DeviceName (Key):
- The name of the audio device.
- You can use regular expression.
- If more than one devices found, all devices are targeted for configuration.
-
[int] Volume (Required):
- The target volume. (0 to 100)
-
[bool] Mute (Write):
- The state of mute.
- Default is
$false
-
[bool] SkipWhenDeviceNotPresent (Write):
- When this property is specied as
$true, this resouce won't throw an error if the device is not found. - Default is
$false
- When this property is specied as
- Example 1: Set the volume of the "Speaker" to 80.
Configuration Example1
{
Import-DscResource -ModuleName AudioVolumeDsc
AudioVolume Speaker80
{
DeviceName = 'Speaker'
Volume = 80
Mute = $false
}
}Copyright (c) 2020 mkht
AudioVolumeDsc is released under the MIT License
https://github.com/mkht/AudioVolumeDsc/blob/master/LICENSEAudioVolumeDsc includes these software / libraries.
- CoreAudio
Copyright (c) 2017 Xavier Flix
Licensed under the MIT License.
- if multiple devices with the same name are found, all devices are targeted for configuration.
- Devices in an inactive state are also targeted for configuration.
- Update CoreAudio.dll (v1.16.0)
- First public release.