Get all download links from Microsoft Evaluation Center

A few weeks ago, the website of the Evaluation Center from Microsoft was down, and I saw a post about it on Tech Community. (Article) People were sharing links to a few ISO files from it to help people who needed them. That got me thinking. What if I could export all of them just in case something happens to the site again?! This blog post describes a method to retrieve all links from the Evaluation Center.

What is Microsoft Evaluation Center?

“The Microsoft Evaluation Center brings you full-featured Microsoft product evaluation software available for download or trial on Microsoft Azure.” It contains downloads and trails you can start, not for production use but for testing.

Requirements of the script

It should be able to retrieve all links from the different topics (Windows 10/11, Windows Server, SQL Server, etc.) for all languages, with a description and the download link itself.

Output

Below is the output of the script. It lets you show which URL is being scanned and how many download links were found.

It generates a CSV file that looks like this in Excel: (Example of a few downloads from the 244 in total):

The script

Below is the script. Change the $outputfile variable to save the output EvalCenterDownloads.csv to a different location.

Note: Run this script from a PowerShell 7 prompt. Running in PowerShell 5 or ISE/VSCode doesn’t work.

#Reset totalcount to null
$totalcount = $null
 
#Set output file location
$outputfile = 'D:\Temp\EvalCenterDownloads.csv'
 
#List of Evalution Center links with downloadable content
$urls = @(
    'https://www.microsoft.com/en-us/evalcenter/download-biztalk-server-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-host-integration-server-2020',
    'https://www.microsoft.com/en-us/evalcenter/download-hyper-v-server-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-hyper-v-server-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-lab-kit',
    'https://www.microsoft.com/en-us/evalcenter/download-mem-evaluation-lab-kit',
    'https://www.microsoft.com/en-us/evalcenter/download-microsoft-endpoint-configuration-manager',
    'https://www.microsoft.com/en-us/evalcenter/download-microsoft-endpoint-configuration-manager-technical-preview',
    'https://www.microsoft.com/en-us/evalcenter/download-microsoft-identity-manager-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-sharepoint-server-2013',
    'https://www.microsoft.com/en-us/evalcenter/download-sharepoint-server-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-sharepoint-server-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-skype-business-server-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-sql-server-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-sql-server-2017-rtm',
    'https://www.microsoft.com/en-us/evalcenter/download-sql-server-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-system-center-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-system-center-2022',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-11-enterprise',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-11-office-365-lab-kit',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2-essentials',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2-essentials',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016-essentials',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019-essentials',
    'https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022'
)
 
#Loop through the urls, search for download links and add to totalfound array and display number of downloads
$ProgressPreference = "SilentlyContinue"
$totalfound = foreach ($url in $urls) {
    try {
        $content = Invoke-WebRequest -Uri $url -ErrorAction Stop
        $downloadlinks = $content.links | Where-Object { `
                $_.'aria-label' -match 'Download' `
                -and $_.outerHTML -match 'fwlink' `
                -or $_.'aria-label' -match '64-bit edition' }    
        $count = $DownloadLinks.href.Count
        $totalcount += $count
        Write-host ("Processing {0}, Found {1} Download(s)..." -f $url, $count) -ForegroundColor Green
        foreach ($DownloadLink in $DownloadLinks) {
            [PSCustomObject]@{
                Title  = $url.split('/')[5].replace('-', ' ').replace('download ', '')
                Name   = $DownloadLink.'aria-label'.Replace('Download ', '')
                Tag    = $DownloadLink.'data-bi-tags'.Split('&')[3].split(';')[1]
                Format = $DownloadLink.'data-bi-tags'.Split('-')[1].ToUpper()
                Link   = $DownloadLink.href
            }
        }
    }
    catch {
        Write-Warning ("{0} is not accessible" -f $url)
    }
}


#Output total downloads found and exports result to the $outputfile path specified
Write-Host ("Found a total of {0} Downloads" -f $totalcount) -ForegroundColor Green
$totalfound | Sort-Object Title, Name, Tag, Format | Export-Csv -NoTypeInformation -Encoding UTF8 -Delimiter ';' -Path $outputfile

Download the script(s) from GitHub here

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.