Skip to content

Commit 506e45b

Browse files
committed
Added Remove-IISLog
1 parent 8dc42cb commit 506e45b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function Remove-IISLog {
2+
[CmdletBinding()]
3+
param(
4+
[Parameter(Mandatory = $true)]
5+
[int]$Days,
6+
7+
[string]$LogFilesFolder = "$env:SystemDrive\inetpub\logs\LogFiles",
8+
9+
[switch]$DryRun
10+
)
11+
12+
process {
13+
if (Test-Path $LogFilesFolder) {
14+
Get-ChildItem $LogFilesFolder -Recurse -Filter *.log | Remove-OldFile -Days $Days -DryRun:$DryRun
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)