Skip to content

chanwang/WindowsAudioDevice-Powershell-Cmdlet

 
 

Repository files navigation

Basic command-line audio device control from Powershell including Nuget Package Manager Console.

Features: Set Volume and toggle Mute on the Default Playback Device. Get a list of devices and set the Default Audio Device.

Install.

From WMF5+

Install-Module -Name AudioDeviceCmdlets

Manual Install

Set-Location "$($profile | Split-Path)\Modules\AudioDeviceCmdlets"
Get-ChildItem | Unblock-File
  • Import the binary module. This can go into your profile.
Import-Module AudioDeviceCmdlets
  • You may need to set the execution policy.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Suggested Aliases. I may set these in the module in the future.

New-Alias -Name Mute -Value Set-DefaultAudioDeviceMute
New-Alias -Name Vol -Value set-DefaultAudioDeviceVolume

Exposed Cmdlets

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

Attribution

Based on work done by Ray M. hosted on The Code Project

About

Powershell Cmdlets for manipulating Windows Audio Devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 94.2%
  • PowerShell 5.8%