Skip to content

Commit 317ef6b

Browse files
committed
Write a warning if a component is not found
1 parent 88c3cc2 commit 317ef6b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function Find-UnitySetupInstaller
231231
else {
232232
$knownBaseUrls = $knownBaseUrls | Sort-Object -Property @{ Expression={[math]::Abs(($_.CompareTo($linkComponents[0])))}; Ascending=$true}
233233
}
234-
234+
235235
$installerTemplates.Keys |
236236
Where-Object { $Components -band $_ } |
237237
ForEach-Object {
@@ -257,12 +257,17 @@ function Find-UnitySetupInstaller
257257
}
258258
}
259259

260-
if( $result ) {
261-
$result
262-
break
263-
}
260+
if( $result ) { break }
261+
}
262+
263+
if( -not $result )
264+
{
265+
Write-Warning "Unable to find installer for the $_ component."
264266
}
267+
else { $result }
268+
265269
} | Sort-Object -Property ComponentType
270+
266271
}
267272

268273
<#

0 commit comments

Comments
 (0)