# Step 1: Set Execution Policy
Set-ExecutionPolicy Bypass -Scope Process -Force
# Step 2: Enable TLS 1.2
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
# Step 3: Install NuGet Package Provider if not already installed
if (!(Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
Install-PackageProvider -Name NuGet -Force
}
# Step 4: Define Chocolatey paths
$chocoPath1 = "C:\ProgramData\chocolatey\bin\choco.exe"
$chocoPath2 = "C:\ProgramData\chocolatey\tools\chocolateyInstall\choco.exe"
# Step 5: Install Chocolatey if not already installed
if (!(Test-Path $chocoPath1) -and !(Test-Path $chocoPath2)) {
Write-Host "Installing Chocolatey..."
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
} else {
Write-Host "Chocolatey is already installed."
}
# Step 6: Refresh environment variables
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Step 7: Verify Chocolatey installation and set the correct path
if (Test-Path $chocoPath1) {
$chocoExe = $chocoPath1
} elseif (Test-Path $chocoPath2) {
$chocoExe = $chocoPath2
} else {
throw "Chocolatey executable not found."
}
Write-Host "Chocolatey version: $((& $chocoExe --version))"
# Step 8: Install multiple Chocolatey packages
$packages = @(
"4k-stogram",
"4k-tokkit",
"4k-video-downloader",
"7zip.install",
"acronis-drive-monitor",
"audacity",
"duplicatefilefinder",
"chrome-remote-desktop-chrome",
"cpu-z.install",
"crystaldiskinfo",
"crystaldiskmark",
"defraggler",
"diskgenius",
"dokan-library",
"partitionmasterfree",
"epson-perfection-v33-scanner",
"eraser",
"firefox",
"fsviewer",
"ffmpeg",
"googledrive",
"handbrake.install",
"hwinfo.install",
"logitech-options",
"makemkv",
"malwarebytes",
"mediainfo",
"mkvtoolnix",
"obs-studio.install",
"openvpn",
"pdf24",
"powershell-core",
"python",
"qbittorrent",
"recuva",
"revo-uninstaller",
"samsung-magician",
"tapwindows",
"gpu-z",
"teracopy",
"veracrypt",
"winrar",
"xnconvert.install"
)
foreach ($package in $packages) {
Write-Host "Installing $package..."
& $chocoExe install $package -y
if ($LASTEXITCODE -eq 0) {
Write-Host "$package has been successfully installed." -ForegroundColor Green
} else {
Write-Host "Failed to install $package. Please check for any errors above." -ForegroundColor Red
}
}
Write-Host "All installations completed." -ForegroundColor Cyan