diff --git a/Cleanup-SystemTempFiles.ps1 b/Cleanup-SystemTempFiles.ps1 index 021456b..d0c0e05 100644 --- a/Cleanup-SystemTempFiles.ps1 +++ b/Cleanup-SystemTempFiles.ps1 @@ -5,19 +5,20 @@ If ( (IsWindowsVersion -ge "6.2") ) { Write-Output "Deleting old AppX log files from ${SysTemp}" Get-ChildItem -Path $SysTemp | Where { $_.Name -like "AppXDeploymentServer_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue + Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-AppXDeploymentServer_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue Get-ChildItem -Path $SysTemp | Where { $_.Name -like "AppxErrorReport_*.txt" } | Remove-Item -Force -ErrorAction SilentlyContinue Get-ChildItem -Path $SysTemp | Where { $_.Name -like "AppXPackaging_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Application_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "System_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-WindowsUpdateClient_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-Store_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-StateRepository_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-SettingSync_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue } ## Remove computer log files -Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-AppReadiness_Admin_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-AppReadiness_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue Get-ChildItem -Path $SysTemp | Where { $_.Name -like "${Env:COMPUTERNAME}-*.log" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Application_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "System_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-WindowsUpdateClient_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-Store_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-StateRepository_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue +Get-ChildItem -Path $SysTemp | Where { $_.Name -like "Microsoft-Windows-SettingSync_*.evtx" } | Remove-Item -Force -ErrorAction SilentlyContinue ## Remove runaway CBS logs $CBSLogDir = "${Env:SystemRoot}\Logs\CBS"