From b2669519ad5b25dad28eeb7f7108360cc9a62d0b Mon Sep 17 00:00:00 2001 From: Tunisiano187 Date: Tue, 16 Apr 2024 20:07:42 +0200 Subject: [PATCH] unable to get picture --- scripts/Get-Package.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Get-Package.ps1 b/scripts/Get-Package.ps1 index 22e8d2236..4f26fab94 100644 --- a/scripts/Get-Package.ps1 +++ b/scripts/Get-Package.ps1 @@ -113,7 +113,12 @@ if(!(Test-Path $icon)) { $regexPattern = '(?<=<iconUrl>).*?(?=</iconurl>)' $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)" + } } }