SkillAgentSearch skills...

AppxSysprepCleaner

PowerShell script to automatically detect and remove AppX packages that block Sysprep execution on Windows 11 during MDT capture.

Install / Use

/learn @Souteeeh/AppxSysprepCleaner
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AppxSysprepCleaner

PowerShell License: MIT

A PowerShell script to automatically detect and remove AppX packages that block Sysprep from completing on Windows 11.

Why?

During the image capture process using MDT and Sysprep, AppX packages like Microsoft.Copilot or Microsoft.StartExperiencesApp may cause Sysprep to fail with error 0x80073cf2.

This script reads Sysprep's log, identifies problematic AppX packages, and removes them cleanly from the system and all user profiles.

Features

  • Parses setupact.log automatically
  • Detects AppX packages that block Sysprep
  • Removes them for all users
  • Removes provisioned packages from the system image

How to use

Run the script as administrator in PowerShell:

Set-ExecutionPolicy Bypass -Scope Process -Force
.\AppxSysprepCleaner.ps1

Then re-run sysprep.exe as usual.

Acknowledgements

This script was inspired by the capture and deployment methodology published by Florian Burnel on IT-Connect:

MDT – How to capture and deploy a Windows 11 23H2 master image

Thank you for making this practical knowledge accessible to the community.

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated1mo ago
Forks0

Languages

PowerShell

Security Score

85/100

Audited on Feb 18, 2026

No findings