41 lines
1.6 KiB
Plaintext
41 lines
1.6 KiB
Plaintext
function Log-Msg {
|
|
param([string]$Message)
|
|
Write-Host $Message -ForegroundColor Cyan
|
|
try {
|
|
Invoke-RestMethod -Uri "http://10.0.10.8:8000/log" -Method Post -Body @{msg=$Message} -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null
|
|
} catch {}
|
|
}
|
|
|
|
Log-Msg "=========================================================="
|
|
Log-Msg "Iniciando Sonda de Diagnostico de Idioma de OS y SQL Server"
|
|
Log-Msg "=========================================================="
|
|
|
|
try {
|
|
$osLocale = Get-WinSystemLocale
|
|
Log-Msg "OS System Locale: $($osLocale.Name)"
|
|
} catch { Log-Msg "Fallo al leer OS System Locale" }
|
|
|
|
try {
|
|
$uiLang = Get-WinUILanguageSystem
|
|
Log-Msg "OS UI Language System: $($uiLang.Name)"
|
|
} catch { Log-Msg "Fallo al leer OS UI Language" }
|
|
|
|
Log-Msg "Buscando la ISO montada de SQL Server..."
|
|
$sqlDrive = (Get-Volume | Where-Object { $_.DriveType -eq 'CD-ROM' -and (Test-Path "$($_.DriveLetter):\setup.exe") }).DriveLetter
|
|
|
|
if ($sqlDrive) {
|
|
Log-Msg "ISO detectada en la unidad $($sqlDrive[0]):\"
|
|
# Las ISOs de SQL Server tienen carpetas como 1033_ENU_LP (Ingles) o 3082_ESN_LP (Espanol)
|
|
$isoLangs = Get-ChildItem -Path "$($sqlDrive[0]):\" -Directory | Where-Object { $_.Name -match '_LP$' } | Select-Object -ExpandProperty Name
|
|
|
|
if ($isoLangs) {
|
|
Log-Msg "Paquetes de idioma detectados en la ISO (LP_Folders): $($isoLangs -join ', ')"
|
|
} else {
|
|
Log-Msg "No se detectaron carpetas con sufijo _LP en la raiz de la ISO."
|
|
}
|
|
} else {
|
|
Log-Msg "ERROR: No se encontro la ISO de SQL Server en ninguna lectora."
|
|
}
|
|
|
|
Log-Msg "Finalizacion de diagnostico. Por favor aguarda nuevas instrucciones."
|