use Where-Object instead of Where
add found items to output
This commit is contained in:
@@ -23,7 +23,7 @@ If ( $DaysWithoutModification -gt 0 ) { Write-Output "Modified : ${DaysWithout
|
||||
Write-Output '-------------------------------------------------------------------------------'
|
||||
|
||||
# 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
|
||||
$_.Name -match '_backup$' -or
|
||||
@@ -55,7 +55,7 @@ Foreach ( $obj in $TEMPORARY_REVIT_OBJECTS ) {
|
||||
$TotalFiles++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output $item
|
||||
$TotalSize += $size
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user