PowerShell: Get Mouse Information
Need to check what pointing device(s) are connected to a machine - for hardware inventory or troubleshooting an input device issue? This one-liner pulls it straight from the system.
Prerequisites:
- Privileges: None
- Module: Built-in, no import needed
Quick Command:
Get-CimInstance -ClassName Win32_PointingDevice | Select-Object Description, Manufacturer, NumberOfButtons, Status
Example Output:
Description Manufacturer NumberOfButtons Status
----------- ------------ --------------- ------
HID-compliant mouse Microsoft 0 OK
HID-compliant mouse Microsoft 0 OK
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
How It Works:
- Get-CimInstance -ClassName Win32_PointingDevice queries all pointing devices recognized by the system - covers mice, touchpads, and trackballs. Note that Win32_Mouse isn't a valid class name in CIM; Win32_PointingDevice is the correct class.
- Description identifies the device, though it's often a generic HID label rather than the actual brand name.
- Manufacturer frequently shows Microsoft even for third-party mice (like Logitech), since Windows' generic HID driver reports itself as the manufacturer rather than the physical device brand.
- Status shows OK if the device is functioning correctly.