remove alias in favor of cmdlet name

This commit is contained in:
2023-10-05 13:19:25 -04:00
parent c628f60289
commit df7f635e26
+1 -1
View File
@@ -4,7 +4,7 @@
If ( $OlderThanDays -is [int] ) {
If ( Test-Path $Path ) {
Write-Output "Deleting all items older than ${OlderThanDays} days in ""${Path}"""
$files = Get-ChildItem $Path | Where { !$_.PSIsContainer -and $_.LastWriteTime -lt (Get-Date).AddDays(-${OlderThanDays}) }
$files = Get-ChildItem $Path | Where-Object { !$_.PSIsContainer -and $_.LastWriteTime -lt (Get-Date).AddDays(-${OlderThanDays}) }
Foreach ( $f in $files ) {
$msg = "Deleting {0}" -f $f.FullName ; Write-Output $msg
Try { Remove-Item $f -Force | Out-Null }