diff --git a/s.txt b/s.txt index 3e1ca60a..13b73a80 100644 --- a/s.txt +++ b/s.txt @@ -32,7 +32,26 @@ if ($sqlDrive) { if ($process.ExitCode -eq 0) { Log-Msg "¡INSTALACION DE SQL SERVER COMPLETADA CON EXITO (Exit 0)!" } else { - Log-Msg "ADVERTENCIA: La instalacion de SQL finalizo con codigo de error: $($process.ExitCode). Posible fallo." + Log-Msg "ADVERTENCIA: La instalacion de SQL finalizo con codigo de error: $($process.ExitCode). Posible fallo de idioma (Language Mismatch)." + Log-Msg "Buscando log de instalacion de SQL Server para diagnostico detallado..." + + $logPath = "C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log" + if (Test-Path $logPath) { + $latestSummary = Get-ChildItem -Path $logPath -Filter "Summary_*.txt" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + if ($latestSummary) { + $content = Get-Content $latestSummary.FullName -Tail 20 | Out-String + Log-Msg "================ DETALLE DE ERROR DE SQL SERVER ================" + # Post log content carefully + try { + Invoke-RestMethod -Uri "http://10.0.10.8:8000/log" -Method Post -Body @{msg=$content} -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null + } catch {} + Log-Msg "===============================================================" + } else { + Log-Msg "No se encontro Summary.txt en la ruta de logs de SQL." + } + } else { + Log-Msg "No se genero el directorio de logs de SQL Server." + } } } else { Log-Msg "ERROR CATASTROFICO: No se encontro el instalador de SQL Server (setup.exe) en ninguna unidad de CD-ROM."