Created
July 3, 2021 17:37
-
-
Save happiness801/64792b63648d87fb51cc433d12b8498d to your computer and use it in GitHub Desktop.
PowerShell example to disconnect/reconnect to BlueTooth device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; USE THIS TO GET THE DEVICE FRIENDLY NAME | |
; Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"} | |
; Get the device details | |
$device = Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth" -and $_.FriendlyName -eq "EXACT DEVICE FRIENDLY NAME"} | |
; Disable the device | |
Disable-PnpDevice -InstanceId $device.InstanceId -Confirm:$false | |
; Sleep for 10 | |
Start-Sleep -Seconds 10 | |
; Re-enable the device | |
Enable-PnpDevice -InstanceId $device.InstanceId -Confirm:$false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment