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

$packagePath = Join-Path $PSScriptRoot "Microsoft-Windows-Client-Language-Pack_x64_es-es.cab"
dism /online /add-package /packagepath:"$packagePath"



Write-Host "`nEtapa 1 de 2 completado. Tras el reinicio, ejecute la parte 2."
Write-Host "`nReiniciando..."
Restart-Computer

