I'm trying to figure out how to make AzCopy work with PS command "Start-Process" in PS script. I am trying to put together a PS script that downloads a folder named "Languages" from Azure Storage Blob Container to local disk using SAS token.
My script looks as following:
Start-Process `
-FilePath "C:\temp\AzCopy\azcopy.exe" `
-ArgumentList "cp 'https://<storageaccountname>.blob.core.windows.net/<blobcontainername>/Languages?<SASTOKEN>' 'C:\Temp' --recursive" `
-Wait `
-Passthru
this syntax gives me the following output:
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
19 3 1492 2004 0,00 2520 1 azcopy
which immediately exits and nothing happens. If I run AzCopy manually as:
azcopy cp 'https://<storageaccountname>.blob.core.windows.net/<blobcontainername>/Languages?<SASTOKEN>' 'C:\Temp' --recursive
it works as expected.