major change to override Write-Error func
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ If ( $OlderThanDays -is [int] ) {
|
||||
Foreach ( $f in $files ) {
|
||||
$msg = "Deleting {0}" -f $f.FullName ; Write-Output $msg
|
||||
Try { Remove-Item $f -Force | Out-Null }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
}
|
||||
} Else { Write-Output "Path does not exist: ""${Path}""" }
|
||||
} Else { Write-Output "The value entered for ""OlderThanDays"" is not an integer" }
|
||||
Reference in New Issue
Block a user