Some helpful utilities to really free up some disk space on Windows 11.
This removes all old Windows update and component packages (also means you can't uninstall updates)
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
# 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'); |