use Where-Object instead of Where

add found items to output
This commit is contained in:
2025-01-02 16:52:59 -05:00
parent ff6d6bb88c
commit 39ae5a4235
@@ -23,7 +23,7 @@ If ( $DaysWithoutModification -gt 0 ) { Write-Output "Modified : ${DaysWithout
Write-Output '-------------------------------------------------------------------------------' Write-Output '-------------------------------------------------------------------------------'
# Identify all files and folders that match the criteria for what we're looking for # Identify all files and folders that match the criteria for what we're looking for
$TEMPORARY_REVIT_OBJECTS = Get-ChildItem -Path $CleanupPath -Recurse | Where { $TEMPORARY_REVIT_OBJECTS = Get-ChildItem -Path $CleanupPath -Recurse | Where-Object {
( (
# Revit model backup folder # Revit model backup folder
$_.Name -match '_backup$' -or $_.Name -match '_backup$' -or
@@ -55,7 +55,7 @@ Foreach ( $obj in $TEMPORARY_REVIT_OBJECTS ) {
$TotalFiles++ $TotalFiles++
} }
} }
Write-Output $item
$TotalSize += $size $TotalSize += $size
} }