⚡ PowerShell 5.1+
Get Pointing Devices Report
Queries Win32_PointingDevice via WMI and reports Pointing Devices in a formatted table, with an optional CSV export.
Get-PointingDeviceReport.ps1
<#
.SYNOPSIS
Reports Pointing Devices on this computer via WMI (Win32_PointingDevice).
.DESCRIPTION
Queries Win32_PointingDevice and displays Name, Manufacturer, NumberOfButtons 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-PointingDeviceReport.ps1
.EXAMPLE
.\Get-PointingDeviceReport.ps1 -ExportPath C:\Reports\pointingdevice.csv
#>
[CmdletBinding()]
param(
[string]$ExportPath
)
$items = Get-CimInstance -ClassName Win32_PointingDevice | Select-Object Name, Manufacturer, NumberOfButtons
if (-not $items) {
Write-Host "No Pointing 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
}