I just found the info I noted about resolving problems when sysprep fails due to some appx packages.
One particular app I found that was blocking me was
MicrosoftWindows.Client.WebExperience_524.23700.10.0_x64__cw5n1h2txyewy
The solution was to open Powershell as Admin and then remove the AppxPackage with the following command;
Code:
Remove-AppxPackage -Package <packagefullname>
example
Code:
Remove-AppxPackage -Package MicrosoftWindows.Client.WebExperience_524.23700.10.0_x64__cw5n1h2txyewy
Which removed the offending package and allowed me to run SysPrep successfully.
Sometimes you need to run the following command to remove the provisioning too, so I run both for each package as it can't hurt;
Code:
Remove-AppxProvisionedPackage -Online -PackageName <packagefullname>
example
Code:
Remove-AppxProvisionedPackage -Online -PackageName MicrosoftWindows.Client.WebExperience_524.23700.10.0_x64__cw5n1h2txyewy
I also found that installing windows updates in audit mode to be useful as this didn't break sysprep.
I wrote a powershell script for it but the manual steps are as follows;
Open a Powershell window as Administrator then run the following commands.
Install-Module -Name PSWindowsUpdate
PowerShell -ExecutionPolicy RemoteSigned -Command Import-Module PSWindowsUpdate;
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
Get-WindowsUpdate
The 4th command above checks if any there are any remaining updates available. If there are, then you may need to repeat the 3rd and 4th again. If updates fail then reboot and repeat steps 2, 3 and 4 again.
Repeat until step 4 shows no updates available.
I also found the image capturing process to work best when using a WinPE bootdisk after sysprep;
Boot the build PC to the WinPE ISO and from the WinPE x64 environment, capture the WIM image using the following command;
example
Dism /Capture-Image /ImageFile:"D:\Golden.wim" /CaptureDir:C:\ /Name:Golden