Posted On March 31, 2019

Windows Cleanup

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Windows Cleanup
#Clean Up the WinSxS Folder
Dism.exe /online /Cleanup-Image /StartComponentCleanup

#Clean Up C:\Temp Folder
del c:\temp -Recurse -Force

#Cleanup Event Log
wevtutil el | Foreach-Object {wevtutil cl “$_”}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Windows Systems Inventory

<# Systems-Inventory.ps1 Version: 0.04 Purpose: to generate a report with information about servers on the…

PowerShell: Get SQL Server Backup Statuses

$computername='sql01' function getSqlBackupInfo ($sqlInstanceName=$env:computername, $dbName){ [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") $location=if($sqlInstanceName.Contains("`\")){ "SQLSERVER:\SQL\$sqlInstanceName\Databases" }else{ "SQLSERVER:\SQL\$sqlInstanceName\DEFAULT\Databases" } function getPacificTime($time){ if($time){ [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($time,'Pacific…

PowerShell: Function to Get Group Members as a Bypass Orphanated SID Errors

Problem: [TESTSERVER]: PS C:\Users\administrator> Get-LocalGroupMember 'Remote Desktop Users' Get-LocalGroupMember : Failed to compare two elements…