Skip to content

Commit f9a8ad8

Browse files
committed
Support for default Hub installs
1 parent 45b666f commit f9a8ad8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ function Uninstall-UnitySetupInstance {
443443
.DESCRIPTION
444444
Get the Unity versions installed and their locations
445445
.PARAMETER BasePath
446-
Under what base pattern should we look for Unity installs? Defaults to 'C:\Program Files*\Unity*'.
446+
Under what base patterns should we look for Unity installs?
447447
.EXAMPLE
448448
Get-UnitySetupInstance
449449
#>
@@ -452,15 +452,17 @@ function Get-UnitySetupInstance
452452
[CmdletBinding()]
453453
param(
454454
[parameter(Mandatory=$false)]
455-
[string] $BasePath = 'C:\Program Files*\Unity*'
455+
[string[]] $BasePath = @('C:\Program Files*\Unity*','C:\Program Files\Unity\Hub\Editor\*')
456456
)
457457

458-
$Path = [io.path]::Combine("$BasePath", 'Editor\Data\UnityExtensions\Unity\Networking\ivy.xml');
458+
foreach( $folder in $BasePath ) {
459+
$path = [io.path]::Combine("$folder", 'Editor\Data\UnityExtensions\Unity\Networking\ivy.xml');
459460

460-
Get-ChildItem $Path -Recurse -ErrorAction Ignore |
461-
ForEach-Object {
461+
Get-ChildItem $path -Recurse -ErrorAction Ignore |
462+
ForEach-Object {
462463
[UnitySetupInstance]::new((Join-Path $_.Directory "..\..\..\..\" | Convert-Path))
463-
}
464+
}
465+
}
464466
}
465467

466468
<#

0 commit comments

Comments
 (0)