Skip to content

Commit

Permalink
fix(msupdate): improve Get-Appx reliability and verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Oct 16, 2024
1 parent d30f714 commit 30bba70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions msupdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ function Get-Appx($Name) {
$obj = Invoke-WebRequest -Uri $url `
-Method "POST" `
-ContentType "application/x-www-form-urlencoded" `
-Body $Body
-Body $Body `
-ConnectionTimeoutSeconds 5 -OperationTimeoutSeconds 5
break
}
catch {
Write-Warning "Request failed with $url, trying next url..."
Write-Warning "Request failed with $url, trying next url... ($_)"
continue
}
}
Expand All @@ -36,6 +37,7 @@ function Get-Appx($Name) {
Write-Warning "Already exists, skiping $linkText"
}
else {
Write-Host "== $linkText ($($link.href))"
Invoke-WebRequest -Uri $link.href -OutFile "$PSScriptRoot\msstore\$linkText"
}
}
Expand All @@ -44,7 +46,7 @@ function Get-Appx($Name) {
break
}
catch {
Write-Warning "Request failed, retrying in 3 seconds..."
Write-Warning "Request failed, retrying in 3 seconds... ($_)"
Start-Sleep -Seconds 3
}
}
Expand Down

0 comments on commit 30bba70

Please sign in to comment.