@echo off cd /d "%~dp0..\.." echo. echo === Posimai PC Audit (Share-Safe) === echo. echo Running audit (share-safe mode)... call npm run audit:pc:share if errorlevel 1 ( echo. echo ERROR: Audit failed. pause exit /b 1 ) echo. echo Opening report viewer... powershell -NoProfile -Command ^ "$j=[System.IO.File]::ReadAllText('%~dp0out\latest.json',[System.Text.Encoding]::UTF8);" ^ "$t=[System.IO.File]::ReadAllText('%~dp0report-viewer.html',[System.Text.Encoding]::UTF8);" ^ "$s='';" ^ "$o=$t.Replace('',$s);" ^ "$p=[System.IO.Path]::Combine([System.IO.Path]::GetTempPath(),'pc-audit-report.html');" ^ "[System.IO.File]::WriteAllText($p,$o,[System.Text.Encoding]::UTF8);" ^ "Start-Process $p" echo. echo This report is safe to share with IT / engineers. echo. pause