@echo off setlocal cd /d "%~dp0" echo. echo === Posimai PC Audit (portable) === echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0Invoke-PcAudit.ps1" if errorlevel 1 ( echo. echo ERROR: Audit failed. PowerShell 5.1+ is required. 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. pause