Compare commits
No commits in common. "d10aab4c6472a8f501a27ba4ca837e78992ed8d8" and "bb2b87f132ac75ad3f1094ebe5897e350674df80" have entirely different histories.
d10aab4c64
...
bb2b87f132
18
setup.ps1
18
setup.ps1
|
|
@ -1,4 +1,4 @@
|
|||
# ============================================================
|
||||
# ============================================================
|
||||
# Skript ustanovki programm
|
||||
# Zapusk: irm https://git.help-d.ru/helmut/auto-turning/raw/branch/main/setup.ps1 | iex
|
||||
# ============================================================
|
||||
|
|
@ -10,7 +10,7 @@ $temp = "$env:TEMP\win_setup"
|
|||
# ============================================================
|
||||
# 1. OTKLYuChENIE ANTIVIRUSA (OBYAZATELNO!)
|
||||
# ============================================================
|
||||
Write-Host "`n[1/5] Antivirus disable..." -ForegroundColor Yellow
|
||||
Write-Host "`n[1/4] Antivirus disable..." -ForegroundColor Yellow
|
||||
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
|
||||
Set-MpPreference -DisableBehaviorMonitoring $true -ErrorAction SilentlyContinue
|
||||
|
|
@ -25,7 +25,7 @@ Write-Host " Antivirus disabled" -ForegroundColor Green
|
|||
# ============================================================
|
||||
# 2. ZAGRUZKA KONFIGA I SPISKA PROGRAMM
|
||||
# ============================================================
|
||||
Write-Host "[2/5] Loading config and program list..." -ForegroundColor Yellow
|
||||
Write-Host "[2/4] Loading config and program list..." -ForegroundColor Yellow
|
||||
|
||||
Remove-Item $temp -Recurse -Force -ErrorAction SilentlyContinue
|
||||
New-Item -ItemType Directory -Path $temp -Force | Out-Null
|
||||
|
|
@ -76,7 +76,7 @@ $programList = $programList | Sort-Object Name
|
|||
# ============================================================
|
||||
# 3. VYBOR PROGRAMM
|
||||
# ============================================================
|
||||
Write-Host "[3/5] Program selection..." -ForegroundColor Yellow
|
||||
Write-Host "[3/4] Program selection..." -ForegroundColor Yellow
|
||||
|
||||
Write-Host "`nAvailable programs in repo:`n" -ForegroundColor Cyan
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ foreach ($prog in $programList) {
|
|||
Write-Host "`n a - ALL programs" -ForegroundColor Green
|
||||
Write-Host " 0 - Cancel`n" -ForegroundColor Gray
|
||||
|
||||
$choice = Read-Host "Select (1 2 3 or 1,2,3 or a)"
|
||||
$choice = Read-Host "Select (numbers separated by space, or a)"
|
||||
|
||||
if ($choice -eq "0") {
|
||||
Write-Host "Canceled" -ForegroundColor Red
|
||||
|
|
@ -105,9 +105,7 @@ $selectedPrograms = @()
|
|||
if ($choice -eq "a") {
|
||||
$selectedPrograms = $allPrograms
|
||||
} else {
|
||||
# Поддержка: "1, 2, 3" или "1 2 3" или "1,2,3"
|
||||
$normalized = $choice -replace ',', ' '
|
||||
foreach ($num in ($normalized -split '\s+') | Where-Object { $_ -match '^\d+$' }) {
|
||||
foreach ($num in ($choice -split '\s+') | Where-Object { $_ -match '^\d+$' }) {
|
||||
if ($progMap[[int]$num]) {
|
||||
$selectedPrograms += $progMap[[int]$num]
|
||||
}
|
||||
|
|
@ -124,7 +122,7 @@ Write-Host "`nSelected: $($selectedPrograms.Count) programs" -ForegroundColor Gr
|
|||
# ============================================================
|
||||
# 4. SKACHIVANIE I USTANOVKA
|
||||
# ============================================================
|
||||
Write-Host "[4/5] Installing programs..." -ForegroundColor Yellow
|
||||
Write-Host "[4/4] Installing programs..." -ForegroundColor Yellow
|
||||
|
||||
$installed = @()
|
||||
$failed = @()
|
||||
|
|
@ -182,7 +180,7 @@ foreach ($prog in $selectedPrograms) {
|
|||
# ============================================================
|
||||
# 5. ChISTKA I VKLYuChENIE ANTIVIRUSA
|
||||
# ============================================================
|
||||
Write-Host "`n[5/5] Cleanup..." -ForegroundColor Yellow
|
||||
Write-Host "`n[5/4] Cleanup..." -ForegroundColor Yellow
|
||||
|
||||
Remove-Item $temp -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Write-Host " Temp files deleted" -ForegroundColor Green
|
||||
|
|
|
|||
Loading…
Reference in New Issue