danjar2014/Analyze-MDMDiagReport ? reverse-engineered prompt

Reverse engineered prompt

Build me a single PowerShell script that takes a Windows MDMDiagReport zip or extracted folder and turns it into a clean offline HTML report that tells me why Autopilot, ESP, or Intune failed. I want it to automatically find the last provisioning session, reconstruct the ESP flow from the logs, and clearly show the first step that got stuck or failed, along with the likely root cause and what to fix.

Please include a simple summary at the top, an apps in error section that combines repeated install failures into one useful table, and expandable detail sections for timelines, ESP phases, install attempts, timestamp checks, and other findings. If no path is given, have it run MdmDiagnosticsTool first and then analyze the result. Add an optional CSV export too. Keep it self contained, work on Windows PowerShell 5.1, and do not require any external modules. If you need to look up current PowerShell or Windows log details online, feel free to do that.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab