To disable a device via PS the following code can be used (skipping the confirmation dialog), it needs to run in an elevated CLI:
Disable-PnpDevice -InstanceID "BTHENUM\DEV_123\1&23E&0&BLUETOOTHDEVICE_001123" -confirm:$false
I created a Function that should run the command on a new elevated CLI but for some reason, it does not work on the above command:
Function turnoff { Start-Process -FilePath powershell.exe -ArgumentList { Disable-PnpDevice -InstanceID "BTHENUM\DEV_123\1&23E&0&BLUETOOTHDEVICE_001123" -confirm:$false } -verb RunAs }
The new CLI briefly opens but closes again and the command is not executed. I haven't found the problem yet, any hints would be appreciated.