Skip to content

Instantly share code, notes, and snippets.

@elmundio87
Last active September 18, 2020 08:16
Show Gist options
  • Save elmundio87/78d56d6fceb909bf9d6341cd1d481f92 to your computer and use it in GitHub Desktop.
Save elmundio87/78d56d6fceb909bf9d6341cd1d481f92 to your computer and use it in GitHub Desktop.
Export all active Visual Studio MSDN subscriptions in an MPN account
/*
Open this page and log in: https://partner.microsoft.com/en-us/dashboard/mpn/membership/benefits/visualstudio
The script will wait 15 seconds to wait for the subscription lists to load before exporting the data.
*/
var output = ""
callback = function(){
var msdnObj = $("table[aria-label='Visual Studio subscriptions'] span")
var msdnArray = Object.keys(msdnObj).map(function (key) { return msdnObj[key]; });
msdnArray.forEach(function(item, index){
if(item.title && item.title.indexOf("@") > -1 ){
// console.log(item.title)
output += item.title + "\n"
}
})
console.log(output)
}
$(".win-icon-ChevronDown").click()
setTimeout(callback, 15000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment