Tagged: Logfile

Remove old logfiles

Want to clean out old logfiles from IIS (or other products)?

    [int] $daysBack = 7,
    [string] $logPath = "C:\Inetpub\Logs\LogFiles"

Get-ChildItem $logPath -Recurse -Include *.LOG | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(0-$daysBack)} | ForEach-Object {
	Write-Host "Processing: " -ForegroundColor Yellow -NoNewline
	Write-Host $_.FullName -ForegroundColor White -NoNewline
	$span = New-TimeSpan $_.CreationTime $(get-date)
	Write-Host " $($span.Days) days old" -ForegroundColor Yellow -NoNewline

	TRY {
        Remove-Item $_.FullName -Force -ErrorAction Stop
        Write-Host " [Deleted]" -ForegroundColor Green

    CATCH {
        Write-Host " [Can't delete]" -ForegroundColor Red

InstallShield – No Log

Ok… It’s kind of hard to find any information on how to completely remove the need for a logfile when installing a InstallShield based setup file.

You can use:
To say where you want the logfile to go.

But… If you completely want to silence it use:

It’s that simple, but it isn’t that simple to find the information.