Tuesday, February 13, 2024

#103: Get all the sound cards installed on system

 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

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...