How Do I Automate Downloads from My. Visualstudio. Com?

When I need to download media from my.visualstudio.com, the content of Visual Studio Downloads is only accessible using my personal credentials.

So trying to download a file anonymously using PowerShell will fail...

Invoke-RestMethod `
    -Uri ' `
    -OutFile "$ENV:PUBLIC\Downloads\SqlDev.iso"
Invoke-RestMethod:

                403 - Forbidden


                403 - Forbidden

However I have no luck adding my credentials...

Invoke-RestMethod `
    -Uri ' `
    -OutFile "$ENV:PUBLIC\Downloads\SqlDev.iso" -Credential (Get-Credential)
Invoke-RestMethod:

                403 - Forbidden


                403 - Forbidden

and I have no idea how to use -Authentication OAuth and -Authentication Bearer, more than it involves some kind of token (or if that will even work).

I have noticed that the actual URL used, when doing a manual download, includes some kind of time limited credentials (?t=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&e=XXXXXXXXXX&h=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&su=1).
I.e. if I try to reuse the URL some time later, I will eventually get 403 - Forbidden again.

Is there a way to automate downloads of my MSDN media that will work every time I run the code?

This is the same question but 5 years ago for MSDN.
How can I get a static download link for a Microsoft MSDN Subscriber Download?

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article