Git Product home page Git Product logo

audiodevicecmdlets's Introduction

Description

AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio devices on Windows

Features

Get list of all audio devices
Get default audio device (playback/recording)
Get default communication audio device (playback/recording)
Get volume and mute state of default audio device (playback/recording)
Get volume and mute state of default communication audio device (playback/recording)
Set default audio device (playback/recording)
Set default communication audio device (playback/recording)
Set volume and mute state of default audio device (playback/recording)
Set volume and mute state of default communication audio device (playback/recording)

Installation

Run as administrator

Install-Module -Name AudioDeviceCmdlets

Usage

Get-AudioDevice -ID <string>			# Get the device with the ID corresponding to the given <string>
Get-AudioDevice -Index <int>			# Get the device with the Index corresponding to the given <int>
Get-AudioDevice -List				# Get a list of all enabled devices as <AudioDevice>
Get-AudioDevice -PlaybackCommunication		# Get the default communication playback device as <AudioDevice>
Get-AudioDevice -PlaybackCommunicationMute	# Get the default communication playback device's mute state as <bool>
Get-AudioDevice -PlaybackCommunicationVolume	# Get the default communication playback device's volume level on 100 as <float>
Get-AudioDevice	-Playback			# Get the default playback device as <AudioDevice>
Get-AudioDevice -PlaybackMute			# Get the default playback device's mute state as <bool>
Get-AudioDevice -PlaybackVolume			# Get the default playback device's volume level on 100 as <float>
Get-AudioDevice -RecordingCommunication		# Get the default communication recording device as <AudioDevice>
Get-AudioDevice -RecordingCommunicationMute	# Get the default communication recording device's mute state as <bool>
Get-AudioDevice -RecordingCommunicationVolume	# Get the default communication recording device's volume level on 100 as <float>
Get-AudioDevice -Recording			# Get the default recording device as <AudioDevice>
Get-AudioDevice -RecordingMute			# Get the default recording device's mute state as <bool>
Get-AudioDevice -RecordingVolume		# Get the default recording device's volume level on 100 as <float>
Set-AudioDevice	<AudioDevice>				# Set the given playback/recording device as both the default device and the default communication device, for its type
Set-AudioDevice <AudioDevice> -CommunicationOnly	# Set the given playback/recording device as the default communication device and not the default device, for its type
Set-AudioDevice <AudioDevice> -DefaultOnly		# Set the given playback/recording device as the default device and not the default communication device, for its type
Set-AudioDevice -ID <string>				# Set the device with the ID corresponding to the given <string> as both the default device and the default communication device, for its type
Set-AudioDevice -ID <string> -CommunicationOnly		# Set the device with the ID corresponding to the given <string> as the default communication device and not the default device, for its type
Set-AudioDevice -ID <string> -DefaultOnly		# Set the device with the ID corresponding to the given <string> as the default device and not the default communication device, for its type
Set-AudioDevice -Index <int>				# Set the device with the Index corresponding to the given <int> as both the default device and the default communication device, for its type
Set-AudioDevice -Index <int> -CommunicationOnly		# Set the device with the Index corresponding to the given <int> as the default communication device and not the default device, for its type
Set-AudioDevice -Index <int> -DefaultOnly		# Set the device with the Index corresponding to the given <int> as the default device and not the default communication device, for its type
Set-AudioDevice -PlaybackCommunicationMuteToggle	# Set the default communication playback device's mute state to the opposite of its current mute state
Set-AudioDevice -PlaybackCommunicationMute <bool>	# Set the default communication playback device's mute state to the given <bool>
Set-AudioDevice -PlaybackCommunicationVolume <float>	# Set the default communication playback device's volume level on 100 to the given <float>
Set-AudioDevice -PlaybackMuteToggle			# Set the default playback device's mute state to the opposite of its current mute state
Set-AudioDevice -PlaybackMute <bool>			# Set the default playback device's mute state to the given <bool>
Set-AudioDevice -PlaybackVolume <float>			# Set the default playback device's volume level on 100 to the given <float>
Set-AudioDevice -RecordingCommunicationMuteToggle	# Set the default communication recording device's mute state to the opposite of its current mute state
Set-AudioDevice -RecordingCommunicationMute <bool>	# Set the default communication recording device's mute state to the given <bool>
Set-AudioDevice -RecordingCommunicationVolume <float>	# Set the default communication recording device's volume level on 100 to the given <float>
Set-AudioDevice -RecordingMuteToggle			# Set the default recording device's mute state to the opposite of its current mute state
Set-AudioDevice -RecordingMute <bool>			# Set the default recording device's mute state to the given <bool>
Set-AudioDevice -RecordingVolume <float>		# Set the default recording device's volume level on 100 to the given <float>
Write-AudioDevice -PlaybackCommunicationMeter	# Write the default playback device's power output on 100 as a meter
Write-AudioDevice -PlaybackCommunicationStream	# Write the default playback device's power output on 100 as a stream of <int>
Write-AudioDevice -PlaybackMeter		# Write the default playback device's power output on 100 as a meter
Write-AudioDevice -PlaybackStream		# Write the default playback device's power output on 100 as a stream of <int>
Write-AudioDevice -RecordingCommunicationMeter	# Write the default recording device's power output on 100 as a meter
Write-AudioDevice -RecordingCommunicationStream	# Write the default recording device's power output on 100 as a stream of <int>
Write-AudioDevice -RecordingMeter		# Write the default recording device's power output on 100 as a meter
Write-AudioDevice -RecordingStream		# Write the default recording device's power output on 100 as a stream of <int>

Build Cmdlet from source

Build instructions
  1. Install Visual Studio 2022

     Workloads: .NET desktop development
    
  2. Create new project from SOURCE folder
    File -> New -> Project From Existing Code...

     Type of project: Visual C#
     Folder: SOURCE
     Name: AudioDeviceCmdlets
     Output type: Class Library
    
  3. Set project properties
    Project -> AudioDeviceCmdlets Properties

     Assembly name: AudioDeviceCmdlets
     Target framework: .NET Framework 4.6.1+
    
  4. Install System.Management.Automation NuGet legacy package
    Project -> Manage NuGet Packages...

     Package source: nuget.org
     Browse: Microsoft.PowerShell.5.1.ReferenceAssemblies
     Install: v1.0.0+
    
  5. Set solution configuration
    Build -> Configuration Manager...

     Active solution configuration: Release
    
  6. Build Cmdlet
    Build -> Build Solution

     AudioDeviceCmdlets\SOURCE\bin\Release\AudioDeviceCmdlets.dll
    
  7. Import Cmdlet to PowerShell on Windows

    $FilePath = "C:\Path\To\AudioDeviceCmdlets\SOURCE\bin\Release\AudioDeviceCmdlets.dll"
    New-Item "$($profile | split-path)\Modules\AudioDeviceCmdlets" -Type directory -Force
    Copy-Item $FilePath "$($profile | split-path)\Modules\AudioDeviceCmdlets\AudioDeviceCmdlets.dll"
    Set-Location "$($profile | Split-Path)\Modules\AudioDeviceCmdlets"
    Get-ChildItem | Unblock-File
    Import-Module AudioDeviceCmdlets

Donation

Thank you for considering a donation
Bitcoin		(BTC) 3AffczXX4Jb2iN8QWQhHQAsj9AqGFXgYUF
BitcoinCash	(BCH) qraf6a3fklta7xkvwkh49zqn6mgnm2eyz589rkfvl3
Ethereum	(ETH) 0xE4EA2A2356C04c8054Db452dCBd6f958F74722dE

Attribution

Based on code originally posted to Code Project by Ray Molenkamp with comments and suggestions by MadMidi
http://www.codeproject.com/Articles/18520/Vista-Core-Audio-API-Master-Volume-Control
Based on code originally posted to GitHub by Chris Hunt
https://github.com/cdhunt/WindowsAudioDevice-Powershell-Cmdlet

audiodevicecmdlets's People

Contributors

cdhunt avatar frgnca avatar notdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiodevicecmdlets's Issues

[Feature Request] Control over Communication's "Reduce The Volume" feature.

In the old sounds control panel there is a communication tab that lets you configure Windows reducing the volume of other sources if it detects a "communication" source playing.

It would be nice if there was a way to control it much like how ADC does already with the sound device settings. IE, being able to set it to "Do Nothing", "Mute All Other Sounds", "Reduce 80%" , or "Reduce 50%"

While I can see other utilities with it, the personal reason why I request this is because the communications reducing volume feature is quite bugged in my experience. Such as it assumes a youtube video to be "communication" and will reduce the volume of discord while talking with friends. So it's working backwards.

It also does not remember being set to "do nothing" setting after a restart. So it will turn on volume reducing every time the computer reboots/starts up. Only time I've ever got to be "fixed" was during one OS reinstall on another machine.

I realize I'm a bit of a outlier with that issue, but eitherway, it'd be a nice additional feature for the cmdlets to have in my opinion, regardless of what my personal usage would be.

Write-AudioDevice should support -Multichannel

Re observations made in issue #66

The underlying data can give peak volume on a device or on each channel in a device.

This would make for a cooler set of progress bars and a more interesting set of data returns.

I will try to include this support in the same PR.

Feature request - Control disabled devices

Is it possible to add the cmdlet to return the device name of the disabled audio device ?

Currently if we execute 'Get-AudioDevice -Playback' after disabling the audio device we get below exception.
Get-AudioDevice : Element not found. (Exception from HRESULT: 0x80070490)
At line:1 char:1

  • Get-AudioDevice -Playback
  •   + CategoryInfo          : NotSpecified: (:) [Get-AudioDevice], COMException
      + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice
    
    

Set-DefaultAudioDevice -Index 1

Hi ,

I'm unable to use the command Set-DefaultAudioDevice I tried several method

Set-DefaultAudioDevice -Index 1
Set-DefaultAudioDevice [-Index] 1

I got the index with the command Get-AudioDeviceList
I got error Set-DefaultAudioDevice : object reference not set to an instance of an object.

Can you give us some examples and does it work on windows 10?

or maybe because I've a french OS?

Pls help me

Feature request - Control spatial audio mode

First of all, I have to thank you for your work on this cmdlet. I have been using it and I love it.

One thing I found that Windows likes to do is, switch spatial audio mode once in a while to 7.1. So, I was wondering if I could enforce spatial audio mode using powershell via this cmdlet, rather than manually checking and changing it everytime.

This may be a feature enhancement. Looking forward to your thoughts.

Getting error during "Import-Module AudioDeviceCmdlets" Operation is not supported.

Hi there,

I'm hoping to fall in love with this Cmdlet, just can't seem to get the darn thing installed.

Here's the script I'm using to install:

New-Item "$($profile | split-path)\Modules\AudioDeviceCmdlets" -Type directory -Force
Copy-Item "H:\Downloads\AudioDeviceCmdlets.dll" "$($profile | split-path)\Modules\AudioDeviceCmdlets\AudioDeviceCmdlets.dll"
Set-Location "$($profile | Split-Path)\Modules\AudioDeviceCmdlets"
Get-ChildItem | Unblock-File
Import-Module AudioDeviceCmdlets

Here's the error I'm getting, I've replaced my username with "[username]".

Import-Module .\AudioDeviceCmdlets.dll
Import-Module : Could not load file or assembly 'file:///C:\Users\[username]\Documents\WindowsPowerShell\Modules\AudioDeviceCmdlets\AudioDeviceCmdlets.dll' or one of its
dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1

Any ideas where to start troubleshooting the issue?

Mute state

Is there a way to determine the state of mute/unmute for the default audio device? I know you can set it, but I want to determine if it is muted or not.

Question: How to get a single value from PlaybackStream

Hi,

Im, like, very new on PowerShell scripts and would like to know if it's possible to get a single value from
Write-AudioDevice -PlaybackStream
command so I can use it afterwards to create a condition showing if something is playing or not and construct an if statement of it.

[Feature Request] Get and Set sampling rate and bit depth

I'm referring to the Advanced tab when inspecting audio devices in control panel where the user can set the sample rate and bit depth for the device.

A common source of audio crackling when funneling audio through virtual audio device is that both the source device and virtual device are not both using the same sample rate/bit depth. Would be great to be able modify this via script.

Script block not working for 'Set-DefaultAudioDevice'

"Get-AudioDeviceList | Where-Object {$.DeviceFriendlyname -like 'SAMSUNG'} | foreach {$.Index}" returns value 4.

However, when I run "Set-DefaultAudioDevice {Get-AudioDeviceList | Where-Object {$.DeviceFriendlyname -like 'SAMSUNG'} | foreach {$.Index}}", the index 0 gets set.

Copy paste from PowerShell window is as below:

PS C:\Windows\system32> Get-AudioDeviceList | Where-Object {$.DeviceFriendlyname -like 'SAMSUNG'} | foreach {$.Index}
4
PS C:\Windows\system32> Set-DefaultAudioDevice {Get-AudioDeviceList | Where-Object {$.DeviceFriendlyname -like 'SAMSUNG'} | foreach {$.Index}}

Index DeviceFriendlyname Device


0 Speakers (Realtek High Definition Audio) CoreAudioApi.MMDevice

Add support for ErrorAction argument

When Set-AudioDevice or Get-AudioDevice is called either with invalid Index number of device ID, the fuctions return a visible error and nothing else. Not even a $null value as a return value. When valid funtcion return value cant't be given (in case of error) it would be good to have a $null value as result, so that I could use these functions in my own scripts and detect when the calls failed. Also it would be good if the function could support '-ErrorAction' parameters as well, so that visible error messages could be suppressed.

Set-DefaultAudioDevice error

I get the following error when I try to use the Set-DefaultAudioDevice cmdlet:

"Set-DefaultAudioDevice : Object reference not set to an instance of an object."

I can import the module without any issues. I don't seem to have any issues with any of the other cmdlets. I'm running 64-bit Windows 10 Pro (PowerShell v5). I don't have an issue on a second computer using 64-bit Windows 7 Pro (PowerShell v4). Both systems have multiple audio devices.

Please let me know if there is any other information I can provide to you.

change the speaker configuration?

is it possible to change the speaker configuration?
For example change from 5.1 surround to stereo and vice versa or something like that for the default device.

Disable/Enable Command

Hello I wonder if a disable/enable command for playback and recording devices would be possible
Thank you very much

Get-AudioDevice -List error when no enabled mic or playback device.

I'm seeing behavior where Get-AudioDevice -List works iff there is at least one playback device AND one recording device enabled. I didn't have a mic enabled and it took some work to figure out that that was causing the error. Error below:

PS C:\WINDOWS\system32> Get-AudioDevice -List
Get-AudioDevice : Element not found. (Exception from HRESULT: 0x80070490)
At line:1 char:1

  • Get-AudioDevice -List
  •   + CategoryInfo          : NotSpecified: (:) [Get-AudioDevice], COMException
      + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice
    

Get-AudioDevice -Playback output is wrong sometimes in scripts

Hi,
I'm using your Cmdlet in a script to determine if the monitors should be turned off or the screensaver should start.

While the terminal output is always correct, the script gets another return from the Cmdlet.

I tried running the script with Powershell, but generally I'm using Powershell Core. Same on both.
The "TV" sound device is an AVR, which is not always turned on (so it vanishes from the playback devices list in Windows). A guess is, that this is causing the issue.

Headset Opt (High Definition Audio Device) is most of the time the only other enabled playback device and it is not even the communication default. There are also no enabled recording devices (empty list, except for disabled devices).

Terminal:

> Get-AudioDevice -Playback | Select-Object -Property Name

Name
----
TV (NVIDIA High Definition Audio)

Script debug output:

IdleTarget: 360
HDMIAudioDevice: TV (NVIDIA High Definition Audio)                 <- The sound device to check for
Dynamic Values:
IdleSeconds: 364.7178016
DefaultSoundDevice: Headset Opt (High Definition Audio Device)     <- Cmdlet output
LockedScreen: 
ActiveDisplay: Keine.

Monitor off - No HDMI Audio

Get-AudioDevice -List Command no longer works - Element not found

As described above, all commands are working, other than List.

> Get-AudioDevice -List
Get-AudioDevice : Element not found. (Exception from HRESULT: 0x80070490)
At line:1 char:1
+ Get-AudioDevice -List
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-AudioDevice], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice

I have re-installed the module as well. Just to make sure that it wasn't an import issue.

> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     3.0.0.0    AudioDeviceCmdlets                  {Get-AudioDevice, Set-AudioDevice, Write-AudioDevice}

Kindly assist.

Feature Request - Disable Audio Device like it is possible in mmsys.cpl

Hello,

this is a higly confusing topic so i try my best to write it as clearly as possible. When you open "Sound" (mmsys.cpl) you have the possibility to disable the sound device. This would be very helpful because some setups require that the device is disabled in sounds.

The confusing part is, you can "disable" sound devices already with powershell with: Get-PnpDevice -Class AudioEndpoint | Disable Pnp-Device (or with wmic) BUT this disables it in the device manager and it removes it from Sounds. This is not what my FR tries to achieve.

LG

Set default communication device without setting default audio device

Hi, thank you for continuing this project! I use it all the time. My one suggestion to improve it would be to add functionality allowing users to set the default communications device without setting the default audio device.

For example, if you right click an audio device in the sounds menu you have two options:
Set Default Device
Set Default Communications Device

If I use Set-AudioDevice it sets the selected audio device as both the defualt device and the default communications device.

Perhaps this already exists and I've simply missed it?

Commands not working when moving script files

Hello everyone,

thank you for the work on this commands, they really helped me in a personal project.

I'm noticed an issue however, i created a script .ps1 file and it's working fine.
However if i copy the ps1 file to another location and try to run it everything works except for the AudioDeviceCmdlets.
It's not giving me any errors, they just don't work(the Set-Audio device in particular).

Request: control microphone (eg. mute)

Would be awesome to have the ability to mute the microphone.

Currently I either have to do it via GUI (fiddly) or have access to the laptop keyboard and hit an awkward key combo. There's also no quick/easy way to check if it's muted within Windows.

Thanks

Supporting Recording Devices

Would be great if the library supported Recording Devices (microphones, etc) in addition to Playback Audio Devices. Specifically specifying which Recording Device is default.

Request: disable a device

I'm looking for the same functionality as Windows 10 Settings > System > Sound > Manage sound devices > [disabling a device].

This is for the use case of disabling the Nvidia output device used by Nvidia Gamestream / Moonlight. The effect is that of restoring sound to the server / PC while the stream continues (and re-enabling the device reverses the effect). This being the best method of (somewhat) disabling Moonlight from the PC and not the client, as currently required.

Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats

Cool set of cmdlets! I've been looking for something like this for quite some time.

Write-AudioDevice hard codes a sleep of 100 milliseconds between samples. This is good enough for many purposes, but not great for analyzing the currently playing audio, thus

  1. Write-AudioDevice should have a [Timespan]SampleInterval parameter, defaulting to 100 milliseconds.

Additionally, it looks like Write-AudioDevice is converting the float value into a 0-100 range. Again, this is fine for a lot of cases, but it looses a lot of precision. Thus:

  1. Write-AudioDevice -PlaybackStream should be able to return floats

It might be nice to be able to get the entire sample buffer as well.

I'm happy to take this particular work item on, as both parts of it should be fairly straightforward.

Feature request?

I have very limited knowledge of POSH, so is it possible to toggle the default communication device ( headset) to out put to both the default speakers and the headset at the same time.

if thats not possible, how would create a desktop shortcut to activate separate devices, right now the only way i know is togo into windows and set default device to the headset or desktop speakers manully

How to check Mute-State of non-default-device

Hi,
First of all, thanks for the handy cmdlet.

I hope this is the right place to ask:

I'm by no means a powershell expert (or even decent for that matter) but I'm currently trying to use your tool to switch from Input Device A to Input Device B if Device B is not muted. Else, I want to switch back.

This is what I currently have:

$Microphone = "{0.0.1.00000000}.{50486949-aae2-4574-97fb-4660fd26b6f7}"
$Headset = "{0.0.1.00000000}.{4bf15a7e-d091-4bcb-ae8f-5cadfdcffca7}"

while (1) {
    $CurrentDevice = Get-AudioDevice -Recording

    if ($currentDevice."ID" -eq $Microphone) {
        Set-AudioDevice -ID $Headset

        if (Get-AudioDevice -RecordingMute) {
            Set-AudioDevice -ID $Microphone
        } else {}
    }
    if ($currentDevice."ID" -eq $Headset) {
        if (Get-AudioDevice -RecordingMute) {
            Set-AudioDevice -ID $Microphone
            Write-Output "going back to Microphone"
        }
    }
    
    sleep 3;
}

But the switching basically cuts my voice for some time every three seconds, so it's pretty impractical. Is there a way to either do this event-based instead of in a loop or by checking the mute state of device B without switching? Or maybe an entirely different approach?

Get-AudioDevice : Parameter set cannot be resolved using the specified named parameters.

Hi,

Seems that the cmdlet is not function well anymore. Can you tell whats the problem?

It's on a Windows 10 1909 Enterprise OS with latest secuirity patches. Also on 20H2 it doesnt work.

Get-AudioDevice : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1

  • Get-AudioDevice
  •   + CategoryInfo          : InvalidArgument: (:) [Get-AudioDevice], ParameterBindingException
      + FullyQualifiedErrorId : AmbiguousParameterSet,AudioDeviceCmdlets.GetAudioDevice
    

Change status of non-default audio device

Wondering if it would be possible to make changes to a device other than the default. I can list the other audio devices with your cmdlets but it appears the only one that can be modified is the default device.

Feature request

This is really impressive and helpful but would it be possible to add separate command for setting default communication device?

It's possible to support sample rate switch?

https://github.com/sirWest/AudioSwitch/issues/149
The same issue another project.

48000 for movie or gaming, 44100 for CD music.
Use a script to switch sample rate before a game launch or before the music player.
WASAPI not a good option, or exclusive mode. I need program use audio device at the same time.

There isn't useful search result in issues...

I plan to create one sample rate switcher via autohotkey, if your AudioDeviceCmdlets already implemented such feature or in future updates, then I don't have to "Reinventing the wheel"...
This is not a feature request and it's just a confirm... Sorry to bother you

Set RootModule node in psd1 to 'AudioDeviceCmdlets.dll' in published module

VIA User mmuffins sends the following message to the owners of item 'AudioDeviceCmdlets'.

Hi there, I just downloaded version 3.0.0.2 of AudioDeviceCmdlets because I wanted to control the audio volume from powershell. Awesome work, it really saved me the effort of writing something like that myself!

I noticed that no cmdlets are exported after installing the module from the gallery. I was able to fix it locally by changing #RootModule = '' to RootModule = 'AudioDeviceCmdlets.dll' in AudioDeviceCmdlets.psd1. It would be great to see a fix for this.

BR, Michael

about the compiler warning about unused fields in struct

You can use #pragma to disable/restore the warning around the struct instead:

#pragma warning disable 649
    internal struct AUDIO_VOLUME_NOTIFICATION_DATA
    {
        public Guid guidEventContext;
        public bool bMuted;
        public float fMasterVolume;
        public uint nChannels;
        public float ChannelVolume;
    }
#pragma warning restore 649

Get-AudioDevice -PlaybackCommunication

I get the following error with this:

`Get-AudioDevice : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-AudioDevice -PlaybackCommunication
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-AudioDevice], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,AudioDeviceCmdlets.GetAudioDevice`

Any help would be appreciated :D

No module manifest included

Would it be possible to add a module manifest file?

That way when I include the dll in $profile/Modules/AudioDeviceCmdlets folder the Get-Module -ListAvailable command works properly. Along with the automatic import feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.