Parsing HTML Tables with PowerShell for BIOS Update Notifications

I wanted to get notified any time there was a new BIOS update for the motherboard that I use on one of my desktop systems, which is an ASRock Phantom Gaming 4. Unfortunately, most motherboard manufacturers have terrible websites, that are hard to navigate, so I had to improvise.

One of the specific challenges I had was that ASRock’s website had the BIOS version table of information hidden behind a button that loads dynamic content into the product page. Without doing some more advanced browser automation with Selenium or Playwright, this would’ve blocked me, but I had a solution.

Instead of letting the page load the dynamic content for me, why I don’t I just load the dynamic content directly? Where do I load this dynamic content from? I needed to find out, so I used the Google Chrome Dev Tools (CTRL + SHIFT + I or F12) to monitor the network when I clicked the “BIOS” button. It turns out that I could access a static HTML page with just the BIOS version table!

Once I retrieved the URL containing the BIOS information, I plugged that into a PowerShell script, and wrote up some regular expression code to parse out the details of each version: the version number, the date each version was published, and the download size of each BIOS package.

function Get-ASRockBIOSVersions {
    param ()
    $Uri = ''
    $result = Invoke-WebRequest -Uri $Uri

    $regex = [regex]'(?<BIOSVersion>\d\.\d{2}).+(?<Date>\d{4}/\d{1,2}/\d{1,2}).+>(?<Size>.+MB)'
    $MatchList = $regex.Matches($result.Content)
    foreach ($Match in $MatchList) { 
            BiosVersion = $Match.Groups['BIOSVersion']
            Date = $Match.Groups['Date']
            Size = $Match.Groups['Size']


The net result of this PowerShell script is a simple array of PowerShell objects that shows me all of the currently available BIOS versions for the motherboard. I can detect when a new version comes out, and send myself an e-mail or text message, using some other mechanism like Amazon Simple E-mail Service (SES) or Simple Notification Service (SNS)!

EDIT: I just came back to this post on 2020-08-11 and used the script. It turns out that, since I published this post, there are two new BIOS versions available! Here are the results of the script.

BiosVersion Date      Size
----------- ----      ----
3.10        2020/8/5  17.31MB
3.00        2020/7/2  17.31MB
2.60        2020/4/16 13.84MB
2.30        2020/3/11 13.84MB
2.20        2019/12/9 13.82MB
1.70        2019/9/17 13.74MB
1.40        2019/8/14 13.73MB
1.30        2019/7/16 13.70MB
1.10        2019/7/3  13.68MB