Skip to content

Commit 256e22c

Browse files
authored
Merge pull request #58 from jwittner/fix/parsingIEDependency
Use basic parsing to avoid IE dependency
2 parents 34ae4f9 + 2909fe2 commit 256e22c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function Find-UnitySetupInstaller
201201
$patchPage = "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
202202
$searchPages += $patchPage
203203

204-
$webResult = Invoke-WebRequest $patchPage
204+
$webResult = Invoke-WebRequest $patchPage -UseBasicParsing
205205
$searchPages += $webResult.Links | Where-Object {
206206
$_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" -and $Matches[1] -gt 1
207207
} | ForEach-Object {
@@ -212,8 +212,8 @@ function Find-UnitySetupInstaller
212212

213213
foreach($page in $searchPages)
214214
{
215-
$webResult = Invoke-WebRequest $page
216-
$prototypeLink = $webResult.Links | Select-Object -ExpandProperty href | Where-Object {
215+
$webResult = Invoke-WebRequest $page -UseBasicParsing
216+
$prototypeLink = $webResult.Links | Select-Object -ExpandProperty href -ErrorAction SilentlyContinue | Where-Object {
217217
$_ -match "$($installerTemplates[[UnitySetupComponentType]::Setup])$"
218218
}
219219

@@ -243,7 +243,7 @@ function Find-UnitySetupInstaller
243243
foreach ( $baseUrl in $knownBaseUrls) {
244244
$endpoint = [uri][System.IO.Path]::Combine($baseUrl, $linkComponents[1], $template);
245245
try {
246-
$testResult = Invoke-WebRequest $endpoint -Method HEAD
246+
$testResult = Invoke-WebRequest $endpoint -Method HEAD -UseBasicParsing
247247
$result = New-Object UnitySetupInstaller -Property @{
248248
'ComponentType' = $_;
249249
'Version' = $Version;

0 commit comments

Comments
 (0)