PowerShell 中管理蓝牙设备可以使用以下命令

获取已知的蓝牙服务列表,你可以尝试使用以下命令:

powershellCopy Code
Get-PnpDevice -Class Bluetooth

这个命令将会列出计算机中的蓝牙设备及其相关信息,包括服务等


PowerShell 命令来获取已配对的蓝牙设备:

powershellCopy Code
Get-WmiObject -Namespace "root\cimv2" -Class Win32_PnPEntity | Where-Object {$_.Name -like "*Bluetooth*"} | Select-Object Name

这个命令将返回一个列表,其中包含所有已配对的蓝牙设备的名称。


列出所有蓝牙设备的详细信息,可以使用以下命令:

powershellCopy Code
Get-WmiObject -Namespace "root\cimv2" -Class Win32_PnPEntity | Where-Object {$_.Name -like "*Bluetooth*"} | Select-Object Name,DeviceID,Status

这个命令将返回一个列表,其中包含所有蓝牙设备的名称、设备 ID 和状态。

 


PowerShell 中管理蓝牙设备可以使用以下命令:

  1. Get-BluetoothDeviceInfo:

    • 用于获取已配对的蓝牙设备信息。
    bashCopy Code
    Get-BluetoothDeviceInfo
  2. Get-BluetoothDevice:

    • 用于获取当前系统中的所有蓝牙设备。
    bashCopy Code
    Get-BluetoothDevice
  3. Add-BluetoothDevice:

    • 用于将蓝牙设备添加到计算机。
    bashCopy Code
    Add-BluetoothDevice -DeviceName "DeviceName"
  4. Remove-BluetoothDevice:

    • 用于从计算机中移除蓝牙设备。
    bashCopy Code
    Remove-BluetoothDevice -DeviceName "DeviceName"
  5. Set-BluetoothDeviceAudio:

    • 用于配置蓝牙音频设备。
    bashCopy Code
    Set-BluetoothDeviceAudio -DeviceName "DeviceName" -Enable $true
  6. Set-BluetoothDevicePower:

    • 用于启用或禁用蓝牙设备。
    bashCopy Code
    Set-BluetoothDevicePower -DeviceName "DeviceName" -PowerState On
  7. Enable-Bluetooth:

    • 用于启用计算机上的蓝牙功能。
    bashCopy Code
    Enable-Bluetooth
  8. Disable-Bluetooth:

    • 用于禁用计算机上的蓝牙功能。
    bashCopy Code
    Disable-Bluetooth

 

PowerShell 还提供了一些其他管理蓝牙设备的命令,例如:

  1. Set-BluetoothDeviceInfo:

    • 用于设置蓝牙设备的信息,如设备名称、类别等。
    bashCopy Code
    Set-BluetoothDeviceInfo -DeviceName "DeviceName" -DeviceType "Headset"
  2. Rename-BluetoothDevice:

    • 用于重命名已配对的蓝牙设备。
    bashCopy Code
    Rename-BluetoothDevice -DeviceName "OldName" -NewName "NewName"
  3. Connect-BluetoothDevice:

    • 用于连接到蓝牙设备。
    bashCopy Code
    Connect-BluetoothDevice -DeviceName "DeviceName"
  4. Disconnect-BluetoothDevice:

    • 用于断开与蓝牙设备的连接。
    bashCopy Code
    Disconnect-BluetoothDevice -DeviceName "DeviceName"
  5. Test-BluetoothDevice:

    • 用于测试与蓝牙设备的连接。
    bashCopy Code
    Test-BluetoothDevice -DeviceName "DeviceName"

这些命令提供了在 PowerShell 中管理蓝牙设备的更多选项。您可以根据您的具体需求选择适合您的命令

 

PowerShell 还有一些其他管理蓝牙设备的命令,具体如下:

  1. Get-BluetoothScanning:

    • 用于获取当前系统中的蓝牙扫描状态。
    bashCopy Code
    Get-BluetoothScanning
  2. Set-BluetoothScanning:

    • 用于启用或禁用蓝牙扫描功能。
    bashCopy Code
    Set-BluetoothScanning -Enabled $true
  3. Enable-BluetoothAdvertisement:

    • 用于启用蓝牙广播功能。
    bashCopy Code
    Enable-BluetoothAdvertisement -BluetoothAddress "Address"
  4. Disable-BluetoothAdvertisement:

    • 用于禁用蓝牙广播功能。
    bashCopy Code
    Disable-BluetoothAdvertisement -BluetoothAddress "Address"
  5. Get-BluetoothLEDevice:

    • 用于获取与蓝牙低功耗设备的连接。
    bashCopy Code
    Get-BluetoothLEDevice -DeviceName "DeviceName"
  6. Start-BluetoothScan:

    • 用于启动蓝牙设备扫描以发现附近的蓝牙设备。
    bashCopy Code
    Start-BluetoothScan
  7. Stop-BluetoothScan:

    • 用于停止蓝牙设备扫描。
    bashCopy Code
    Stop-BluetoothScan

这些命令提供了更多选项来管理蓝牙设备和相关功能。

 

PowerShell 还提供了一些其他管理蓝牙设备的命令,例如:

  1. Get-BluetoothAudioDevice:

    • 用于获取已连接或可用于连接的蓝牙音频设备。
    bashCopy Code
    Get-BluetoothAudioDevice
  2. Show-BluetoothDeviceClass:

    • 用于显示蓝牙设备的设备类别。
    bashCopy Code
    Show-BluetoothDeviceClass
  3. Show-BluetoothDeviceInfo:

    • 用于显示指定蓝牙设备的详细信息。
    bashCopy Code
    Show-BluetoothDeviceInfo -DeviceName "DeviceName"
  4. Show-BluetoothDeviceHistory:

    • 用于显示与指定蓝牙设备相关的事件历史记录。
    bashCopy Code
    Show-BluetoothDeviceHistory -DeviceName "DeviceName"
  5. Show-BluetoothDeviceNotification:

    • 用于显示与指定蓝牙设备相关的通知。
    bashCopy Code
    Show-BluetoothDeviceNotification -DeviceName "DeviceName"
  6. Update-BluetoothDeviceInfo:

    • 用于更新已配对蓝牙设备的信息。
    bashCopy Code
    Update-BluetoothDeviceInfo -DeviceName "DeviceName" -NewDeviceName "NewName"

这些命令提供了更多的选项来管理蓝牙设备,您可以根据您的具体需求选择适合您的命令。

 

PowerShell 还提供了一些其他管理蓝牙的命令,例如:

  1. Get-BluetoothDeviceInfo:

    • 用于获取指定蓝牙设备的信息。
    bashCopy Code
    Get-BluetoothDeviceInfo -DeviceName "DeviceName"
  2. Get-BluetoothDevice :

    • 用于获取所有已配对的蓝牙设备。
    bashCopy Code
    Get-BluetoothDevice
  3. Register-BluetoothDevice :

    • 用于将蓝牙设备注册到系统中。
    bashCopy Code
    Register-BluetoothDevice -Path "DevicePath"
  4. Remove-BluetoothDevice :

    • 用于从系统中移除已配对的蓝牙设备。
    bashCopy Code
    Remove-BluetoothDevice -DeviceName "DeviceName"
  5. Set-BluetoothDevice :

    • 用于设置蓝牙设备的属性。
    bashCopy Code
    Set-BluetoothDevice -Name "DeviceName" -Property "PropertyValue"

这些命令提供了更多选项来管理蓝牙设备。您可以根据您的具体需求选择适合您的命令。

与蓝牙相关的常用 PowerShell 命令:

  1. Get-BluetoothDeviceInfo:

    • 获取指定蓝牙设备的信息。
    bashCopy Code
    Get-BluetoothDeviceInfo -DeviceName "DeviceName"
  2. Get-BluetoothDevice:

    • 获取系统中所有已配对的蓝牙设备。
    bashCopy Code
    Get-BluetoothDevice
  3. Register-BluetoothDevice:

    • 将蓝牙设备注册到系统中。
    bashCopy Code
    Register-BluetoothDevice -Path "DevicePath"
  4. Remove-BluetoothDevice:

    • 从系统中移除已配对的蓝牙设备。
    bashCopy Code
    Remove-BluetoothDevice -DeviceName "DeviceName"
  5. Set-BluetoothDevice:

    • 设置蓝牙设备的属性。
    bashCopy Code
    Set-BluetoothDevice -Name "DeviceName" -Property "PropertyValue"
  6. Show-BluetoothDeviceClass:

    • 显示蓝牙设备的设备类别。
    bashCopy Code
    Show-BluetoothDeviceClass
  7. Show-BluetoothDeviceInfo:

    • 显示指定蓝牙设备的详细信息。
    bashCopy Code
    Show-BluetoothDeviceInfo -DeviceName "DeviceName"
  8. Show-BluetoothDeviceHistory:

    • 显示与指定蓝牙设备相关的事件历史记录。
    bashCopy Code
    Show-BluetoothDeviceHistory -DeviceName "DeviceName"

这些命令可用于在 PowerShell 中管理蓝牙设备

  1. Get-BluetoothAudioDevice:

    • 获取已连接或可用于连接的蓝牙音频设备。
    bashCopy Code
    Get-BluetoothAudioDevice
  2. Show-BluetoothDeviceNotification:

    • 显示与指定蓝牙设备相关的通知。
    bashCopy Code
    Show-BluetoothDeviceNotification -DeviceName "DeviceName"
  3. Update-BluetoothDeviceInfo:

    • 更新已配对蓝牙设备的信息。
    bashCopy Code
    Update-BluetoothDeviceInfo -DeviceName "DeviceName" -NewDeviceName "NewName"

这些命令提供了更多的选项来管理蓝牙设备

PowerShell 还提供了其他一些与蓝牙相关的命令,例如:

  1. Get-BluetoothHidDevice:

    • 获取已连接或可用于连接的蓝牙 HID(Human Interface Device)设备。
    bashCopy Code
    Get-BluetoothHidDevice
  2. Show-BluetoothHidDeviceDetail:

    • 显示与指定蓝牙 HID 设备相关的详细信息。
    bashCopy Code
    Show-BluetoothHidDeviceDetail -HidDevicePath "DevicePath"
  3. Connect-BluetoothDevice:

    • 连接到指定的蓝牙设备。
    bashCopy Code
    Connect-BluetoothDevice -DeviceName "DeviceName"
  4. Disconnect-BluetoothDevice:

    • 从指定蓝牙设备断开连接。
    bashCopy Code
    Disconnect-BluetoothDevice -DeviceName "DeviceName"
  5. Show-BluetoothPendingPairing:

    • 显示正在等待配对的蓝牙设备。
    bashCopy Code
    Show-BluetoothPendingPairing
  6. Start-BluetoothScan:

    • 开始扫描周围的蓝牙设备。
    bashCopy Code
    Start-BluetoothScan
  7. Stop-BluetoothScan:

    • 停止扫描周围的蓝牙设备。
    bashCopy Code
    Stop-BluetoothScan

这些命令提供了更多选项来管理蓝牙设备

  1. Get-BluetoothComPort:

    • 获取与蓝牙设备关联的 COM 端口信息。
    bashCopy Code
    Get-BluetoothComPort
  2. Show-BluetoothDeviceDriver:

    • 显示与指定蓝牙设备相关的驱动程序信息。
    bashCopy Code
    Show-BluetoothDeviceDriver -DeviceName "DeviceName"
  3. Set-BluetoothHidDeviceUsage:

    • 设置蓝牙 HID 设备的使用情况。
    bashCopy Code
    Set-BluetoothHidDeviceUsage -HidDevicePath "DevicePath" -Usage "UsageType"
  4. Set-BluetoothHidDeviceUsagePage:

    • 设置蓝牙 HID 设备的使用页面。
    bashCopy Code
    Set-BluetoothHidDeviceUsagePage -HidDevicePath "DevicePath" -UsagePage "PageType"
  5. Show-BluetoothHidDeviceUsage:

    • 显示与指定蓝牙 HID 设备相关的使用情况。
    bashCopy Code
    Show-BluetoothHidDeviceUsage -HidDevicePath "DevicePath"

这些命令提供了更多选项来管理蓝牙设备及其相关属性

  1. Get-BluetoothDeviceInfo:

    • 获取指定蓝牙设备的详细信息,如设备地址、名称、类别等。
    bashCopy Code
    Get-BluetoothDeviceInfo -DeviceName "DeviceName"
  2. Get-BluetoothFileTransfer:

    • 获取正在进行的蓝牙文件传输操作的状态。
    bashCopy Code
    Get-BluetoothFileTransfer
  3. Show-BluetoothPairing:

    • 显示已配对的蓝牙设备列表。
    bashCopy Code
    Show-BluetoothPairing
  4. Remove-BluetoothDevice:

    • 从系统中移除指定的蓝牙设备。
    bashCopy Code
    Remove-BluetoothDevice -DeviceName "DeviceName"
  5. Set-BluetoothDeviceInfo:

    • 设置指定蓝牙设备的信息,如设备名称。
    bashCopy Code
    Set-BluetoothDeviceInfo -DeviceName "DeviceName" -Name "NewName"

这些命令提供了更多选项来管理蓝牙设备及其相关属性

  1. Set-BluetoothAudioDevice:

    • 设置蓝牙音频设备的状态,例如启用或禁用。
    bashCopy Code
    Set-BluetoothAudioDevice -DeviceName "DeviceName" -Enabled $true
  2. Show-BluetoothAudioDevice:

    • 显示已连接的蓝牙音频设备列表。
    bashCopy Code
    Show-BluetoothAudioDevice
  3. Set-BluetoothAudioRoute:

    • 设置蓝牙音频设备的音频路由,例如将音频路由到蓝牙耳机或扬声器。
    bashCopy Code
    Set-BluetoothAudioRoute -DeviceName "DeviceName" -AudioRoute "RouteType"
  4. Set-BluetoothPairingConfiguration:

    • 配置蓝牙设备的配对行为,例如设置是否自动配对等。
    bashCopy Code
    Set-BluetoothPairingConfiguration -AutoPairEnabled $true
  5. Show-BluetoothL2CapLayerStatistics:

    • 显示蓝牙 L2CAP 层的统计信息。
    bashCopy Code
    Show-BluetoothL2CapLayerStatistics

这些命令提供了更多选项来管理蓝牙设备及其相关属性

  1. Get-BluetoothScannedDevice:

    • 获取已扫描到的蓝牙设备列表。
    bashCopy Code
    Get-BluetoothScannedDevice
  2. Get-BluetoothTrustedDevices:

    • 获取已信任的蓝牙设备列表。
    bashCopy Code
    Get-BluetoothTrustedDevices
  3. Invoke-BluetoothPairing:

    • 强制启动蓝牙设备配对过程。
    bashCopy Code
    Invoke-BluetoothPairing -DeviceName "DeviceName"
  4. Set-BluetoothHciEventFilter:

    • 配置蓝牙控制器的事件筛选器。
    bashCopy Code
    Set-BluetoothHciEventFilter -EventType "EventType" -Filter "FilterType"
  5. Show-BluetoothServices:

    • 显示蓝牙服务的列表及其状态。
    bashCopy Code
    Show-BluetoothServices

这些命令提供了更多选项来管理蓝牙设备及其相关属性

  1. Get-BluetoothRadioInfo:

    • 获取系统上蓝牙无线电的信息,如名称、状态、类别等。
    bashCopy Code
    Get-BluetoothRadioInfo
  2. Set-BluetoothHidDevicePin:

    • 设置连接到系统的蓝牙 HID 设备的 PIN 码。
    bashCopy Code
    Set-BluetoothHidDevicePin -DeviceName "DeviceName" -Pin "PIN"
  3. Set-BluetoothHidDeviceProtection:

    • 设置蓝牙 HID 设备的安全保护级别。
    bashCopy Code
    Set-BluetoothHidDeviceProtection -DeviceName "DeviceName" -ProtectionLevel "Level"
  4. Show-BluetoothDeviceClass:

    • 显示系统中已知的蓝牙设备类别列表。
    bashCopy Code
    Show-BluetoothDeviceClass
  5. Show-BluetoothManufacturerSettings:

    • 显示蓝牙制造商特定的设置信息。
    bashCopy Code
    Show-BluetoothManufacturerSettings

这些命令提供了更多选项来管理蓝牙设备及其相关属性

 

posted @ 2024-02-27 05:36  suv789  阅读(403)  评论(0编辑  收藏  举报