Add list-bluetooth-devices.ps1

This commit is contained in:
Markus Fleschutz 2021-12-03 12:49:05 +01:00
parent 494c697861
commit 7b0ef3ab6a

View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Lists all Bluetooth devices
.DESCRIPTION
This script lists all Bluetooth devices.
.EXAMPLE
PS> ./list-bluetooth-devices
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"}
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}