Skip to content

Instantly share code, notes, and snippets.

@wincmd64
Last active March 9, 2023 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wincmd64/aa680b1ece5e049b37ddae001e12df5e to your computer and use it in GitHub Desktop.
Save wincmd64/aa680b1ece5e049b37ddae001e12df5e to your computer and use it in GitHub Desktop.
# Авто-установка chocolatey и софта
# Использование: powershell -ExecutionPolicy Bypass -File "choco.ps1"
# https://t.me/wincmd64
# ps ver check
if ($PSversiontable.psversion -lt "5.1") {
Write-Host "POWERSHELL UPDATE NEEDED -- https://microsoft.com/download/details.aspx?id=54616"
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
exit
}
# choco check
if(-not(Get-Command choco -ErrorAction SilentlyContinue)) {
Write-Host "INSTALL CHOCO?" -ForegroundColor Red
pause
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
} else {
choco list --localonly
}
Write-Host "INSTALL SOFT?" -ForegroundColor Red
pause
choco install 7zip -y
if ([System.Environment]::OSVersion.Version.ToString(2) -eq "10.0") {
# win 10+
choco install vcredist140 -y
} elseif ([System.Environment]::OSVersion.Version.ToString(2) -eq "6.1") {
# win 7
choco install firefoxesr -y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment