Register-WmiEvent -Class Win32_DeviceChangeEvent -SourceIdentifier USBWatch -Action {
$devices = Get-PnpDevice | Where-Object { $_.InstanceId -like "*USB*" -or $_.FriendlyName -match "Android|ADB|Unknown|MTP" }
$time = Get-Date -Format "HH:mm:ss"
Write-Host "`n[$time] USB change"
$devices | Select-Object FriendlyName, Status, InstanceId | Format-Table -AutoSize
}