Skip to content

Instantly share code, notes, and snippets.

@happiness801
Created July 3, 2021 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happiness801/64792b63648d87fb51cc433d12b8498d to your computer and use it in GitHub Desktop.
Save happiness801/64792b63648d87fb51cc433d12b8498d to your computer and use it in GitHub Desktop.
PowerShell example to disconnect/reconnect to BlueTooth device
; 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