HyperV
Update VM-W11-SYSPREP
Optimize-VHD -Path "C:\HyperV\VM-W11-SYSPREP\VM-W11-SYSPREP.vhdx" -Mode Full
Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like '*Microsoft.Winget.Source*' } | Remove-AppxPackage
if ((Get-FileHash "C:\Windows\System32\Sysprep\unattend.xml" -Algorithm SHA256).Hash -eq "5FEE2B1A28CE90A8CAAD81F05B343D40B598E37E93BE08BB56C3825E78CAC1DF") { "Hash matches" } else { "Hash does NOT match" }
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:C:\Windows\System32\Sysprep\unattend.xml
Depoly SBX from SYSPREP
$h="B20609F75130DB6EA41A9C8DB844E18E4B085246E4606957A0335DA7A12EBCC4";$p=(Read-Host "Path to .ps1 file").Trim('"');if(Test-Path $p){if((Get-FileHash $p -Algorithm SHA256).Hash -eq $h){"Hash matches"}else{"Hash does NOT match"}}else{"File not found"}
C:\Scripts\Win11Debloat.ps1
Update VM-W11-SBX-##
winget update
winget update --all