Skip to content

Instantly share code, notes, and snippets.

Windows Deep Clean

Some helpful utilities to really free up some disk space on Windows 11.

Cleanup WinSxS folder:

This removes all old Windows update and component packages (also means you can't uninstall updates)

DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

@jonanderson10
jonanderson10 / startup.ps1
Created February 24, 2024 04:38
ECS Windows Container Entrypoint Script
# This script is our container entrypoint since Windows containers only get environment
# variables at the process level. This makes them machine level so that IIS can see them.
Write-Host "Stopping IIS Service (this is expected, and in anticipation of setting environment variables)..."
Stop-Service -Name W3SVC -Force
Write-Host "Starting environment variable setup..."
foreach($key in [System.Environment]::GetEnvironmentVariables('Process').Keys) {
if ([System.Environment]::GetEnvironmentVariable($key, 'Machine') -eq $null) {
$val = [System.Environment]::GetEnvironmentVariable($key, 'Process');