如何使用 PowerShell 列出我附近的蓝牙设备

Yoa*_*oan 7 windows powershell bluetooth netsh

如何列出所有已配对或当前靠近我的蓝牙设备以及特定的 MAC 地址?我想要相当于命令:

netsh wlan show network mode=bssid
Run Code Online (Sandbox Code Playgroud)

我可以使用以下命令列出所有蓝牙设备和特征,但不能列出 MAC 地址:

Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"}
foreach ($device in $devices) { echo $device.InstanceId }
Run Code Online (Sandbox Code Playgroud)

请注意,如果我需要手动缩小结果并且列表的布局不完美,这不是问题。

Ano*_*yme 4

PowerShell 命令:

Get-ChildItem -Path HKLM:\SYSTEM\ControlSet001\Services\DeviceAssociationService\State\Store\ | Select-String -Pattern Bluetooth
Run Code Online (Sandbox Code Playgroud)

将打印已配对的设备:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DeviceAssociationService\State\Store\Bluetooth#BluetoothXX:XX:XX:XX:XX:b2-YY:YY:YY:YY:YY:YY
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DeviceAssociationService\State\Store\Bluetooth#BluetoothXX:XX:XX:XX:XX:b2-ZZ:ZZ:ZZ:ZZ:ZZ:ZZ
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DeviceAssociationService\State\Store\BluetoothLE#BluetoothLEXX:XX:XX:XX:XX:b2-WW:WW:WW:WW:WW:WW
Run Code Online (Sandbox Code Playgroud)

这些XX:XX:XX:XX:XX值是您的蓝牙 MAC 地址。