Sometimes, we get into situation where we are developiong something that requires listing all the soundcards in the system. You can do it easily with below code:
# Get all sound devices
$soundDevices = Get-PnpDevice -Class AudioEndpoint
# Output information about each sound device
foreach ($device in $soundDevices) {
Write-Output "Device ID: $($device.DeviceID)"
Write-Output "Description: $($device.Description)"
Write-Output "Manufacturer: $($device.Manufacturer)"
Write-Output "Driver Version: $($device.DriverVersion)"
Write-Output "Status: $($device.Status)"
Write-Output "-----------------------------"
}
w code:
No comments:
Post a Comment