File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -1245,16 +1245,20 @@ function Get-UnitySetupInstanceVersion {
12451245
12461246 # Try to look in the modules.json file for installer paths that contain version info
12471247 if ( Test-Path " $path \modules.json" - PathType Leaf ) {
1248+ try {
1249+ Write-Verbose " Searching $path \modules.json for module versions"
1250+ $table = (Get-Content " $path \modules.json" - Raw) | ConvertFrom-Json - AsHashtable
12481251
1249- Write-Verbose " Searching $path \modules.json for module versions"
1250- $modules = (Get-Content " $path \modules.json" - Raw) | ConvertFrom-Json
1251-
1252- foreach ( $module in $modules ) {
1253- Write-Verbose " `t Testing DownloadUrl $ ( $module.DownloadUrl ) "
1254- if ( $module.DownloadUrl -notmatch " (\d+)\.(\d+)\.(\d+)([fpab])(\d+)" ) { continue ; }
1252+ foreach ( $url in $table.downloadUrl ) {
1253+ Write-Debug " `t Testing DownloadUrl $url "
1254+ if ( $url -notmatch " (\d+)\.(\d+)\.(\d+)([fpab])(\d+)" ) { continue ; }
12551255
1256- Write-Verbose " `t Found version!"
1257- return [UnityVersion ]$Matches [0 ]
1256+ Write-Verbose " `t Found version!"
1257+ return [UnityVersion ]$Matches [0 ]
1258+ }
1259+ }
1260+ catch {
1261+ Write-Verbose " Error parsing $path \modules.json:`n`t $_ "
12581262 }
12591263 }
12601264
You can’t perform that action at this time.
0 commit comments