Skip to content

Commit 6af6dfd

Browse files
committed
Simplify test and format
1 parent 0f63e8e commit 6af6dfd

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,19 +1141,18 @@ function Get-UnitySetupInstance {
11411141
}
11421142
}
11431143

1144-
1145-
$BasePath | Where-Object { Test-Path $_ -PathType Container } |
1146-
Get-ChildItem -Directory | Where-Object { (Get-UnityEditor $_.FullName).Count -gt 0 } |
1144+
Get-ChildItem -Path $BasePath -Directory -ErrorAction Ignore |
1145+
Where-Object { (Get-UnityEditor $_.FullName).Count -gt 0 } |
11471146
ForEach-Object {
1148-
$path = $_.FullName
1149-
try {
1150-
Write-Verbose "Creating UnitySetupInstance for $path"
1151-
[UnitySetupInstance]::new($path)
1152-
}
1153-
catch {
1154-
Write-Warning "$_"
1147+
$path = $_.FullName
1148+
try {
1149+
Write-Verbose "Creating UnitySetupInstance for $path"
1150+
[UnitySetupInstance]::new($path)
1151+
}
1152+
catch {
1153+
Write-Warning "$_"
1154+
}
11551155
}
1156-
}
11571156
}
11581157

11591158
<#

0 commit comments

Comments
 (0)