From 2bbbff7f9d6d52736c872c9294820bbd75b1141f Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Thu, 2 May 2019 17:21:06 -0700 Subject: [PATCH] Look for expected unity.exe instead of searching recursively --- UnitySetup/UnitySetup.psm1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 7dc734f..b93cf96 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -264,10 +264,11 @@ function Get-UnityEditor { foreach ($p in $Path) { switch ($currentOS) { ([OperatingSystem]::Windows) { - $editor = Get-ChildItem "$p" -Filter 'Unity.exe' -Recurse | - Select-Object -First 1 -ExpandProperty FullName - - Write-Output $editor + $editor = Join-Path "$p" 'Editor\Unity.exe' + + if (Test-Path $editor) { + Write-Output (Resolve-Path $editor).Path + } } ([OperatingSystem]::Linux) { throw "Get-UnityEditor has not been implemented on the Linux platform. Contributions welcomed!";