Grab linki do zdjęć ze strony HTML za pomocą Powershell

Chciałbym pobrać kilka galerii zdjęć luzem. Obrazy są oferowane bezpłatnie, bez wymaganych uprawnień. Ja dla mojego życia nie mogę go uruchomić. To jest to, co mam do tej pory. Wypluj $ pattern to cała linia HTML, a nie tylko link do obrazu. Czy są jakieś wskazówki, które możesz mi dać? Pętla jest uruchamiana tylko raz dla celów testowych. Pętla przejdzie przez wszystkie strony uporządkowane numerycznie.

# Variables
$i=1        # Webpage Counter
$j=1        # Image Counter
$rootDir = "http://website.com/sport/galleries/"
$saveDir = "C:\Users\user\Desktop\"
$webpagetxt = "C:\Users\user\Desktop\page.txt"
$links = "C:\Users\user\Desktop\links.txt"
$regex = "http://website.com/galleries/[0-9]*/[^\.]*.JPG"

# Create folder to download to
#New-Item -Name SiouxSportsGalleries -ItemType directory

# Start Web Client
$client = New-Object System.Net.WebClient

# Main loop to get image links and download
    For($i=10; $i -le 10; $i++){

        # Download source code of the web page.
        $url = $rootDir+$i+'.htm'
        $webclient = new-object System.Net.WebClient
        $webpage = $webclient.DownloadString($url)
        $webpage > "$webpagetxt"

    # Parse web page and find image link.
       $pattern = Get-Content $webpagetxt | Select-String -pattern $regex -Allmatches
       echo "This is the link" $pattern
    #$pattern > $links

 }

questionAnswers(2)

yourAnswerToTheQuestion