Skip to content

Commit db4f983

Browse files
committed
Added Remove-TempASPNETFile
1 parent 506e45b commit db4f983

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

WindowsDiskCleanup/Public/Remove-OldFile.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Remove-OldFile {
2727
Write-Host "[Dry] Removing $($File.FullName)" -ForegroundColor Yellow
2828
}
2929
else {
30-
Remove-Item -Path $File.FullName -Force
30+
Remove-Item -Path $File.FullName -Force -Recurse
3131
}
3232
}
3333
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function Remove-TempASPNETFile {
2+
[CmdletBinding()]
3+
param(
4+
[Parameter(Mandatory = $true)]
5+
[int]$Days,
6+
7+
[string]$FolderPath = "$env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root",
8+
9+
[switch]$DryRun
10+
)
11+
12+
process {
13+
if (Test-Path $FolderPath) {
14+
Get-ChildItem $FolderPath | Remove-OldFile -Days $Days -DryRun:$DryRun
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)