Compress WinSXS: A Script to compress WinSXS folder resided in Windows directory. if you are concern about the growing size of WinSXS folder taking so much of space then you can use this powershell script to reduce the size by compressing WinSXS folder data. This script is very usefull in the case when you need to compress WinSXS folder in large number of Servers/Desktops environment. #——————————————– # Script to compress WinSXS folder try { $winDir = “$($env:windir)” $winSxSDir = “$winDir\WinSxS” $aclPath = “$winDir\WinSxS.acl” $serviceMSI = “msiserver” $serviceTI = “TrustedInstaller” Stop-Service $serviceMSI Stop-Service $serviceTI Set-Service -Name $serviceMSI -StartupType Disabled Set-Service -Name $serviceTI -StartupType Disabled icacls.exe $winSxSDir /save $aclPath /t takeown /f $winSxSDir /r icacls $winSxSDir /grant “$($env:USERDOMAIN)\$($env:USERNAME)”:”(F)” /t compact /s:$winSxSDir /c /a /i * icacls $winSxSDir /setowner “NT SERVICE\TrustedInstall
We are all apprentices in a craft where no one ever becomes a master.