PowerShell - Check active world quests

I was looking for a way to quickly check if a particular world quest was active today. I found this topic on the US forums - https://us.forums.blizzard.com/en/wow/t/check-if-certain-world-quest-is-up/37791. I can’t post there so I will add my voice here.

This is simply to check if specific quests are active. It says nothing about whether you’ve completed them etc. It uses the data on WoWHead. Run the following in PowerShell.

add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
        ServicePoint srvPoint, X509Certificate certificate,
        WebRequest request, int certificateProblem) {
        return true;
    }
}
"@

$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

$strHTML = $(Invoke-WebRequest https://www.wowhead.com/world-quests/legion/eu -UseBasicParsing | Select-Object -ExpandProperty Content)
$strHTML += $(Invoke-WebRequest https://www.wowhead.com/world-quests/bfa/eu -UseBasicParsing | Select-Object -ExpandProperty Content)

$arrQuests = @(
            ("48100", "The Defense of Eredath", "/way #882 54.6 16.8"),
            ("48936", "Slithon the Last", "/way #882 48.6 53.6")
)

foreach ($arrQuest in $arrQuests)
{
    $strMatch = '"id":' + $arrQuest[0] + ',"ending"'

    if ($strHTML -match $strMatch) {Write-Host YES - $arrQuest[1] - $arrQuest[2]}
    else {Write-Host NO - $arrQuest[1]}
}

The following can be amended to suit:

  • $arrQuests to determine which quests you want to check for
  • $strHTML to add in each expansion you want to look for

If you don’t know what you’re looking at, don’t run it. Never run code you haven’t verified yourself.