PowerShell 技能连载 - 管理蓝牙设备(第 2 部分)

如果您只是在 Windows 中寻找一种快速的方法来配对和接触配对蓝牙设备,请尝试以下命令:

1
PS> explorer.exe ms-settings-connectabledevices:devicediscovery   

这将立即弹出一个对话框,显示所有蓝牙设备。只需在 PowerShell 中添加一个函数,因此您不必记住命令,只需要将其放入个人资料脚本中:

1
2
3
PS> function Show-Bluetooth { explorer.exe ms-settings-connectabledevices:devicediscovery }

PS> Show-Bluetooth

如果您想在桌面放一个蓝牙图标的快捷方式,请尝试以下操作:

1
2
3
4
5
6
7
8
$desktop = [Environment]::GetFolderPath('Desktop')
$path = Join-Path -Path $desktop -ChildPath 'bluetooth.lnk'
$shell = New-Object -ComObject WScript.Shell
$scut = $shell.CreateShortcut($path)
$scut.TargetPath = 'explorer.exe'
$scut.Arguments = 'ms-settings-connectabledevices:devicediscovery'
$scut.IconLocation = 'fsquirt.exe,0'
$scut.Save()

PowerShell 技能连载 - 管理蓝牙设备(第 2 部分)

http://blog.vichamp.com/2022/05/04/managing-bluetooth-devices-part-2/

作者

吴波

发布于

2022-05-04

更新于

2022-07-06

许可协议

评论