@@ -842,9 +842,15 @@ function Install-UnitySetupInstance {
842
842
843
843
if ( -not $PSBoundParameters.ContainsKey (' BasePath' ) ) {
844
844
$defaultInstallPath = switch ($currentOS ) {
845
- ([OperatingSystem ]::Windows) { ' C:\Program Files\Unity' }
846
- ([OperatingSystem ]::Linux) { throw " Install-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!" ; }
847
- ([OperatingSystem ]::Mac) { ' /Applications/Unity' }
845
+ ([OperatingSystem ]::Windows) {
846
+ " C:\Program Files\Unity\Hub\Editor\"
847
+ }
848
+ ([OperatingSystem ]::Linux) {
849
+ throw " Install-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!" ;
850
+ }
851
+ ([OperatingSystem ]::Mac) {
852
+ " /Applications/Unity/Hub/Editor/"
853
+ }
848
854
}
849
855
}
850
856
else {
@@ -876,7 +882,7 @@ function Install-UnitySetupInstance {
876
882
}
877
883
}
878
884
else {
879
- $installPath = " $defaultInstallPath - $installVersion "
885
+ $installPath = [ io.path ]::Combine( $defaultInstallPath , $installVersion )
880
886
}
881
887
882
888
if ($currentOS -eq [OperatingSystem ]::Mac) {
@@ -1405,7 +1411,7 @@ function Start-UnityEditor {
1405
1411
}
1406
1412
1407
1413
$projectPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath ($ ($p.Path ))
1408
- $instanceArgs += , (" -projectPath" , $projectPath )
1414
+ $instanceArgs += , (" -projectPath" , " `" $projectPath `" " )
1409
1415
$setupInstances += , $setupInstance
1410
1416
}
1411
1417
@@ -1497,7 +1503,7 @@ function Write-UnityErrors {
1497
1503
Write-Verbose " Checking $LogFileName for errors"
1498
1504
$errors = Get-Content $LogFileName | Where-Object { Get-IsUnityError $_ }
1499
1505
if ( $errors.Count -gt 0 ) {
1500
- $errors = $errors | select - uniq # Unity prints out errors as they occur and also in a summary list. We only want to see each unique error once.
1506
+ $errors = $errors | Select-Object - uniq # Unity prints out errors as they occur and also in a summary list. We only want to see each unique error once.
1501
1507
$errorMessage = $errors -join " `r`n "
1502
1508
$errorMessage = " Errors were found in $LogFileName `:`r`n $errorMessage "
1503
1509
Write-Error $errorMessage
0 commit comments