@@ -49,7 +49,6 @@ class UnitySetupInstance {
49
49
[string ]$Path
50
50
51
51
UnitySetupInstance([string ]$path ) {
52
- $version = $null
53
52
$currentOS = Get-OperatingSystem
54
53
55
54
if ( Test-Path " $path \modules.json" ) {
@@ -59,7 +58,7 @@ class UnitySetupInstance {
59
58
$module.DownloadUrl -match " (\d+)\.(\d+)\.(\d+)([fpb])(\d+)" | Out-Null
60
59
61
60
if ( $Matches -ne $null ) {
62
- $version = [UnityVersion ]$Matches [0 ]
61
+ $this .Version = [UnityVersion ]$Matches [0 ]
63
62
break
64
63
}
65
64
}
@@ -68,18 +67,17 @@ class UnitySetupInstance {
68
67
# We'll attempt to search for the version using the ivy.xml definitions for legacy editor compatibility.
69
68
$ivy = Get-ChildItem - Path $path - Filter ivy.xml - Recurse - ErrorAction SilentlyContinue - Force | Select-Object - First 1
70
69
71
- if ( Test-Path $ivy.FullName ) {
70
+ if ( $null -ne $ivy ) {
72
71
[xml ]$xmlDoc = Get-Content $ivy.FullName
73
- $version = [UnityVersion ]$xmlDoc .' ivy-module' .info.unityVersion
72
+ $this .Version = [UnityVersion ]$xmlDoc .' ivy-module' .info.unityVersion
74
73
}
75
74
}
76
75
77
76
if ( $version -eq $null ) {
78
- throw " Failed to find a valid installation at $path !" ;
77
+ throw " Failed to find a valid version identifier for installation at $path !" ;
79
78
}
80
79
81
80
$this.Path = $path
82
- $this.Version = $version
83
81
84
82
$playbackEnginePath = $null
85
83
$componentTests = switch ($currentOS ) {
@@ -1104,7 +1102,7 @@ function Get-UnitySetupInstance {
1104
1102
}
1105
1103
1106
1104
$searchPaths = Get-ChildItem $BasePath | Get-ChildItem | ForEach-Object { $_.Directory.FullName }
1107
- $searchPaths = $searchPaths | select - uniq
1105
+ $searchPaths = $searchPaths | Select-Object - uniq
1108
1106
$setupInstances = [UnitySetupInstance []]@ ()
1109
1107
1110
1108
foreach ( $path in $searchPaths ) {
0 commit comments