If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')){
	Write-Host "Auto elevando permisos como Administrador."; Write-Host "    3"; Start-Sleep 1; Write-Host "    2"; Start-Sleep 1;Write-Host "    1"; Start-Sleep 1; Start-Process powershell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs; Exit
}

$ErrorActionPreference = 'silentlycontinue'

# Cambia al directorio donde se encuentra el script
Set-Location -Path $PSScriptRoot

Set-WinUILanguageOverride -Language es-ES
Set-WinUserLanguageList -LanguageList es-ES -Force
Set-WinSystemLocale es-ES
Set-Culture es-ES
Set-WinHomeLocation -GeoId 11



reg add "HKCU\Control Panel\International" /v iCountry /t REG_SZ /d 54 /f
reg add "HKCU\Control Panel\International" /v Locale /t REG_SZ /d 00002C0A /f
reg add "HKCU\Control Panel\International" /v LocaleName /t REG_SZ /d es-ES /f
reg add "HKCU\Control Panel\International" /v sLanguage /t REG_SZ /d ESN /f
reg add "HKCU\Control Panel\International" /v iFirstDayOfWeek /t REG_SZ /d 6 /f
reg add "HKCU\Control Panel\International" /v sShortDate /t REG_SZ /d "dd/MM/yyyy" /f
reg add "HKCU\Control Panel\International" /v sCurrency /t REG_SZ /d "$" /f

reg add "HKCU\Control Panel\International\Geo" /v Name /t REG_SZ /d AR /f
reg add "HKCU\Control Panel\International\Geo" /v Nation /t REG_SZ /d 11 /f



reg add "HKU\.DEFAULT\Control Panel\International" /v iCountry /t REG_SZ /d 54 /f
reg add "HKU\.DEFAULT\Control Panel\International" /v Locale /t REG_SZ /d 00002C0A /f
reg add "HKU\.DEFAULT\Control Panel\International" /v LocaleName /t REG_SZ /d es-ES /f
reg add "HKU\.DEFAULT\Control Panel\International" /v sLanguage /t REG_SZ /d ESN /f
reg add "HKU\.DEFAULT\Control Panel\International" /v iFirstDayOfWeek /t REG_SZ /d 6 /f
reg add "HKU\.DEFAULT\Control Panel\International" /v sShortDate /t REG_SZ /d "dd/MM/yyyy" /f
reg add "HKU\.DEFAULT\Control Panel\International" /v sCurrency /t REG_SZ /d "$" /f

reg add "HKU\.DEFAULT\Control Panel\International\Geo" /v Name /t REG_SZ /d AR /f
reg add "HKU\.DEFAULT\Control Panel\International\Geo" /v Nation /t REG_SZ /d 11 /f

reg add "HKU\.DEFAULT\Control Panel\International\User Profile" /v Languages /t REG_MULTI_SZ /d es-ES /f


Write-Host "`nEtapa 2 de 2 completado."
Write-Host "`nReiniciando..."
Restart-Computer
