I want to mass download vscode and a few addons from marketplace as *.vsix
.
Is there a way to authentice myself or in anyway circumvent the rate limit?
Something between 20 and 50% of all downloads get finished.
# Hashtable of direct download links with lots of links
$Addons = [ordered]@{
PowerShell = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/PowerShell/latest/vspackage";
CPlusPlus = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/cpptools/latest/vspackage";
}
# Download from $Addons hashtable
foreach ($Key in $Addons.Keys) {
$Url = $($Addons[$Key])
Invoke-WebRequest $Url -OutFile "$Key.vsix"
}
I receive the following error since Marketplace has quite strict rate limits.
Invoke-WebRequest $Url -OutFile "$Key.vsix"
{"$id":"1","innerException":null,"message":"Request was blocked due to exceeding usage of
resource 'Count' in namespace 'AnonymousId'. For more information on why your request was
blocked, see the topic \"Rate limits\" on the Microsoft Web site
(https://go.microsoft.com/fwlink/?LinkId=823950).","typeName":"Microsoft.TeamFoundation.
Framework.Server.RequestBlockedException, Microsoft.TeamFoundation.Framework.Server",
"typeKey":"RequestBlockedException","errorCode":0,"eventId":3000}