I'm trying to access MTP device storage to automate file copy, backup, etc. If Windows Explorer is able to open and browse Android device Internal Storage and connected SD card, how can I access these storages with PowerShell?
I've found a lots of hints, such as "get device ID and use WMI"
What is the way the Windows Explorer uses to open and browse especialy Android's storages?
Is it possible to use some System.IO Class like here?
$drives = [System.IO.DriveInfo]::GetDrives()
$r = $drives | Where-Object { $_.DriveType -eq 'Removable' -and $_.IsReady }
if ($r) {
return @($r)[-1]
}
I'm able to access and browse content of local MTP (android) device with this:
$WIAdialog = New-Object -ComObject “WIA.CommonDialog”
$Device = $WIAdialog.ShowSelectDevice()
$Device = $WIAdialog.ShowAcquireImage()
$Device = $WIAdialog.ShowAcquisitionWizard()
$Device = $WIAdialog.ShowDeviceProperties()
$Device = $WIAdialog.ShowItemProperties()
$Device = $WIAdialog.ShowPhotoPrintingWizard()
$Device = $WIAdialog.ShowSelectItems()
$Device = $WIAdialog.ShowTransfer()
But this code is loading information about stored pictures which is too slow even at local computer. Is it possible to avoid loading info about pictures to speed up loading and accessing remotely connected devices?
Thanks in advance for any information and hints!