Skip to content

Instantly share code, notes, and snippets.

@mvark
Created February 15, 2024 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvark/107a103ca8166b9fb7f4c0c24c2ebc0a to your computer and use it in GitHub Desktop.
Save mvark/107a103ca8166b9fb7f4c0c24c2ebc0a to your computer and use it in GitHub Desktop.
This PowerShell script is based on a script by MotoX80. It fetches all the tags listed on Microsoft Q&A along with their hyperlinks to construct this web page - https://codepen.io/mvark/full/zYbyLgd
1..15 | foreach {
$page = Invoke-WebRequest "https://learn.microsoft.com/en-us/answers/tags/?orderBy=Popular&page=$($_)"
$page.AllElements | Where-Object -Property Class -eq 'card-title' | ForEach-Object {
"<li><a href=`"https://learn.microsoft.com$($_.href)`" target=`"_blank`">$($_.innerText)</a></li>"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment