Script de instalación en Powershell
# Descargar e instalar Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Comprobar la instalación de Chocolatey
$chocoPath = [System.Environment]::GetEnvironmentVariable("ChocolateyInstall", "Machine")
if ($chocoPath -eq $null) {
Write-Host "La instalación de Chocolatey ha fallado."
} else {
Write-Host "Chocolatey se ha instalado correctamente en: $chocoPath"
}
Script de instalación a través de la ventana de comandos
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"