I'm using the Start-BitsTransfer
command to download remote resources in powershell scripts.
However, it seems that the command does not take the correct filename when the url is a short url.
For example, these url: http://ligman.me/1IW1oab
redirect actually to http://download.microsoft.com/DOWNLOAD/D/6/7/D670D322-5771-409E-BF34-5B98496DEB0A/MICROSOFT_PRESS_EBOOK_INTRODUCING_AZURE_PDF.PDF
(HTTP 301 response).
But when I execute
Start-BitsTransfer http://ligman.me/1IW1oab
The result filename is 1IW1oab
Is there a way to use this command and the obtain the right filename?