# MenuContextual.ps1
function Reiniciar-Explorer {
    Write-Host "Reiniciando el Explorador de Windows..." -ForegroundColor Yellow
    Stop-Process -Name explorer -Force
    Start-Process explorer
    Write-Host "Explorador reiniciado." -ForegroundColor Green
}

function Activar-Menu-Clasico {
    Write-Host "Activando el menú contextual clásico..." -ForegroundColor Cyan
    New-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Value "" -Force | Out-Null
    Start-Sleep -Seconds 1
    Reiniciar-Explorer
}

function Restaurar-Menu-Moderno {
    Write-Host "Restaurando el menú contextual moderno..." -ForegroundColor Cyan
    Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 1
    Reiniciar-Explorer
}

function Mostrar-Menu {
    Clear-Host
    Write-Host "===== Cambiar Menú Contextual en Windows 11 =====" -ForegroundColor Magenta
    Write-Host "1. Activar menú clásico (Windows 10)"
    Write-Host "2. Restaurar menú moderno (Windows 11)"
    Write-Host "3. Salir"
    $opcion = Read-Host "`nSelecciona una opción (1-3)"

    switch ($opcion) {
        "1" { Activar-Menu-Clasico }
        "2" { Restaurar-Menu-Moderno }
        "3" { exit }
        default {
            Write-Host "Opción no válida. Intenta de nuevo." -ForegroundColor Red
            Pause
            Mostrar-Menu
        }
    }
}

Mostrar-Menu
