fix array building

This commit is contained in:
2022-08-18 18:59:01 -04:00
parent 048a28537c
commit bad0d24027
+4 -2
View File
@@ -1,11 +1,13 @@
# Set the maximum allowed age of Revit local files
$FileAllowedAge = (Get-Date).AddMonths(-1)
# Build all Revit local paths
$RevitLocalPaths = @()
ForEach ( $userProfile in (Get-ChildItem -Path "${Env:SystemDrive}\Users" | Where-Object { $_.PSIsContainer }) ) {
If ( Test-Path "${userProfile}\Documents\Revit Locals" ) { LogMsg "Adding search path: ""${userProfile}""" ; $RevitLocalPaths.Add("${userProfile}\Documents\Revit Locals") }
If ( Test-Path "${userProfile}\Documents" ) { LogMsg "Adding search path: ""${userProfile}""" ; $RevitLocalPaths.Add("${userProfile}\Documents") }
$profilePath = $userProfile.FullName
If ( Test-Path "${profilePath}\Documents\Revit Locals" ) { $RevitLocalPaths += ,@("${profilePath}\Documents\Revit Locals") }
If ( Test-Path "${profilePath}\Documents" ) { $RevitLocalPaths += ,@("${profilePath}\Documents") }
}
ForEach ( $path in $RevitLocalPaths ) {