Skip to content

Commit

Permalink
unable to get picture
Browse files Browse the repository at this point in the history
  • Loading branch information
tunisiano187 committed Apr 16, 2024
1 parent 550e69b commit b266951
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/Get-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ if(!(Test-Path $icon)) {
$regexPattern = '(?<=&lt;iconUrl&gt;).*?(?=&lt;/iconurl&gt;)'
$urlMatch = $pageContent.Content | Select-String -Pattern $regexPattern -AllMatches
if ($urlMatch.Matches.Count -gt 0) {
Invoke-WebRequest -Uri $urlMatch.Matches[0].Value -OutFile "$icon.$(($urlMatch.Matches[0].Value).split('.')[-1])" -ErrorAction Continue
try {
Invoke-WebRequest -Uri $urlMatch.Matches[0].Value -OutFile "$icon.$(($urlMatch.Matches[0].Value).split('.')[-1])"
}
catch {
"Unable to download picture from $($urlMatch.Matches[0].Value)"
}
}
}

Expand Down

0 comments on commit b266951

Please sign in to comment.