Issue
I'm trying to get the root folder of a connected android device with powershell, when I try the standard command for this in the cmd it just works as expected and returns the path.
CMD
adb -s <DeviceId> shell echo $EXTERNAL_STORAGE
When I try to replicate this command in powershell I get nothing not even an error.
PowerShell
Invoke-Expression -Command "adb -s <DeviceId> shell echo $EXTERNAL_STORAGE" | Out-String
I've searched for some solutions and have found a way to make it work in powershell but I was wondering if their is an other way to get the same result without calling cmd.exe in powershell
Working PowerShell but seems doggy
(cmd.exe /c adb -s $Id shell echo `$EXTERNAL_STORAGE) | Out-String
Solution
Just specify the command as-is.
$Result = & adb -s $Id shell echo `$EXTERNAL_STORAGE
Write-Host $Result
Answered By - lit
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.