⚡ PowerShell 5.1+
Get Sound Devices Report
Queries Win32_SoundDevice via WMI and reports Sound Devices in a formatted table, with an optional CSV export.
Get-SoundDeviceReport.ps1
<#
.SYNOPSIS
Reports Sound Devices on this computer via WMI (Win32_SoundDevice).
.DESCRIPTION
Queries Win32_SoundDevice and displays Name, Manufacturer, Status for each item found.
Use -ExportPath to also save the results to a CSV file.
.PARAMETER ExportPath
Optional path to a .csv file to write the results to.
.EXAMPLE
.\Get-SoundDeviceReport.ps1
.EXAMPLE
.\Get-SoundDeviceReport.ps1 -ExportPath C:\Reports\sounddevice.csv
#>
[CmdletBinding()]
param(
[string]$ExportPath
)
$items = Get-CimInstance -ClassName Win32_SoundDevice | Select-Object Name, Manufacturer, Status
if (-not $items) {
Write-Host "No Sound Devices found." -ForegroundColor Yellow
return
}
$items | Format-Table -AutoSize
if ($ExportPath) {
$items | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
Write-Host "`nExported to $ExportPath" -ForegroundColor Cyan
}